Skip to content

Commit

Permalink
tools/power/x86/intel-speed-select: Show error for invalid CPUs in th…
Browse files Browse the repository at this point in the history
…e options

When --cpu or -c is used to specify target CPUs and non of them are valid,
display error.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Srinivas Pandruvada authored and Andy Shevchenko committed Mar 20, 2020
1 parent fe6fb21 commit 070fdea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/power/x86/intel-speed-select/isst-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static void for_each_online_target_cpu_in_set(
void (*callback)(int, void *, void *, void *, void *), void *arg1,
void *arg2, void *arg3, void *arg4)
{
int i;
int i, found = 0;

for (i = 0; i < topo_max_cpus; ++i) {
int online;
Expand All @@ -439,9 +439,14 @@ static void for_each_online_target_cpu_in_set(
online =
1; /* online entry for CPU 0 needs some special configs */

if (online && callback)
if (online && callback) {
callback(i, arg1, arg2, arg3, arg4);
found = 1;
}
}

if (!found)
fprintf(stderr, "No valid CPU in the list\n");
}

#define BITMASK_SIZE 32
Expand Down

0 comments on commit 070fdea

Please sign in to comment.