diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c index 33de17efb4df..a6b918fff5e4 100644 --- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c @@ -337,22 +337,22 @@ long parse_optarg_string(char *s) long i; char *endptr; - if (!strncmp(s, "default", 7)) + if (strcmp(s, "default") == 0) return OPTARG_NORMAL; - if (!strncmp(s, "normal", 6)) + if (strcmp(s, "normal") == 0) return OPTARG_NORMAL; - if (!strncmp(s, "power", 9)) + if (strcmp(s, "power") == 0) return OPTARG_POWER; - if (!strncmp(s, "balance-power", 17)) + if (strcmp(s, "balance-power") == 0) return OPTARG_BALANCE_POWER; - if (!strncmp(s, "balance-performance", 19)) + if (strcmp(s, "balance-performance") == 0) return OPTARG_BALANCE_PERFORMANCE; - if (!strncmp(s, "performance", 11)) + if (strcmp(s, "performance") == 0) return OPTARG_PERFORMANCE; errno = 0;