tools/power/x86/intel-speed-select: Output success/failed for command output
Command output has confusing data, returning "0" on success. For example |# ./intel-speed-select -c 14 turbo-freq enable Intel(R) Speed Select Technology Executing on CPU model:106[0x6a] package-1 die-0 cpu-14 turbo-freq enable:0 To avoid confusion change the command output to 'success' or 'failed'. v2: Remove help output line. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
49aed155ec
commit
522586a9d5
|
@ -1514,7 +1514,6 @@ static void usage(void)
|
||||||
printf("\tResult display uses a common format for each command:\n");
|
printf("\tResult display uses a common format for each command:\n");
|
||||||
printf("\tResults are formatted in text/JSON with\n");
|
printf("\tResults are formatted in text/JSON with\n");
|
||||||
printf("\t\tPackage, Die, CPU, and command specific results.\n");
|
printf("\t\tPackage, Die, CPU, and command specific results.\n");
|
||||||
printf("\t\t\tFor Set commands, status is 0 for success and rest for failures\n");
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -519,7 +519,10 @@ void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
|
||||||
snprintf(header, sizeof(header), "%s", feature);
|
snprintf(header, sizeof(header), "%s", feature);
|
||||||
format_and_print(outf, 4, header, NULL);
|
format_and_print(outf, 4, header, NULL);
|
||||||
snprintf(header, sizeof(header), "%s", cmd);
|
snprintf(header, sizeof(header), "%s", cmd);
|
||||||
snprintf(value, sizeof(value), "%d", result);
|
if (!result)
|
||||||
|
snprintf(value, sizeof(value), "success");
|
||||||
|
else
|
||||||
|
snprintf(value, sizeof(value), "failed(error %d)", result);
|
||||||
format_and_print(outf, 5, header, value);
|
format_and_print(outf, 5, header, value);
|
||||||
|
|
||||||
format_and_print(outf, 1, NULL, NULL);
|
format_and_print(outf, 1, NULL, NULL);
|
||||||
|
|
Loading…
Reference in New Issue