]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/power/x86/intel-speed-select: Fix some program return value
authorZhang Rui <rui.zhang@intel.com>
Thu, 19 Mar 2026 05:52:54 +0000 (13:52 +0800)
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Sun, 5 Apr 2026 18:46:21 +0000 (11:46 -0700)
When running the "intel-speed-select -h" command, it returns
1. 0 when using a version that is API incompatible.
2. 1 when using a version that is API compatible.
And this is confusing.

Fix the program to return 0 for "-h" parameter, and return 1 whenever
"Incompatible API versions" is detected.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
tools/power/x86/intel-speed-select/isst-config.c

index 3f2573ecca762c0bc05d94844b37e46090a0d9a2..b1376411cfa44553a0631f82faab94ef2c683a41 100644 (file)
@@ -1139,7 +1139,7 @@ static int isst_fill_platform_info(void)
 
        if (isst_platform_info.api_version > supported_api_ver) {
                printf("Incompatible API versions; Upgrade of tool is required\n");
-               return -1;
+               exit(1);
        }
 
 set_platform_ops:
@@ -3195,7 +3195,7 @@ static void usage(void)
                printf("\tTo get full turbo-freq information dump:\n");
                printf("\t\tintel-speed-select turbo-freq info -l 0\n");
        }
-       exit(1);
+       exit(0);
 }
 
 static void print_version(void)