Commit 070fdea1 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Andy Shevchenko

tools/power/x86/intel-speed-select: Show error for invalid CPUs in the options

When --cpu or -c is used to specify target CPUs and non of them are valid,
display error.
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent fe6fb216
...@@ -425,7 +425,7 @@ static void for_each_online_target_cpu_in_set( ...@@ -425,7 +425,7 @@ static void for_each_online_target_cpu_in_set(
void (*callback)(int, void *, void *, void *, void *), void *arg1, void (*callback)(int, void *, void *, void *, void *), void *arg1,
void *arg2, void *arg3, void *arg4) void *arg2, void *arg3, void *arg4)
{ {
int i; int i, found = 0;
for (i = 0; i < topo_max_cpus; ++i) { for (i = 0; i < topo_max_cpus; ++i) {
int online; int online;
...@@ -439,9 +439,14 @@ static void for_each_online_target_cpu_in_set( ...@@ -439,9 +439,14 @@ static void for_each_online_target_cpu_in_set(
online = online =
1; /* online entry for CPU 0 needs some special configs */ 1; /* online entry for CPU 0 needs some special configs */
if (online && callback) if (online && callback) {
callback(i, arg1, arg2, arg3, arg4); callback(i, arg1, arg2, arg3, arg4);
found = 1;
}
} }
if (!found)
fprintf(stderr, "No valid CPU in the list\n");
} }
#define BITMASK_SIZE 32 #define BITMASK_SIZE 32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment