aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-09-29 09:50:11 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-29 09:53:04 -0400
commit7c4f45397057506415d1cbf3e30b90674f2e0ec0 (patch)
treed6b13e47c8be301c5a786ace003f2ec8c3cf2ae5 /drivers/cpufreq/cpufreq.c
parentcf30af76952b0cb20c4a2cf8db16d69ca59eb652 (diff)
cpufreq: Replace strnicmp with strncasecmp
The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6463f35f8be8..6fdd5c702258 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -437,7 +437,7 @@ static struct cpufreq_governor *__find_governor(const char *str_governor)
437 struct cpufreq_governor *t; 437 struct cpufreq_governor *t;
438 438
439 list_for_each_entry(t, &cpufreq_governor_list, governor_list) 439 list_for_each_entry(t, &cpufreq_governor_list, governor_list)
440 if (!strnicmp(str_governor, t->name, CPUFREQ_NAME_LEN)) 440 if (!strncasecmp(str_governor, t->name, CPUFREQ_NAME_LEN))
441 return t; 441 return t;
442 442
443 return NULL; 443 return NULL;
@@ -455,10 +455,10 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
455 goto out; 455 goto out;
456 456
457 if (cpufreq_driver->setpolicy) { 457 if (cpufreq_driver->setpolicy) {
458 if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) { 458 if (!strncasecmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
459 *policy = CPUFREQ_POLICY_PERFORMANCE; 459 *policy = CPUFREQ_POLICY_PERFORMANCE;
460 err = 0; 460 err = 0;
461 } else if (!strnicmp(str_governor, "powersave", 461 } else if (!strncasecmp(str_governor, "powersave",
462 CPUFREQ_NAME_LEN)) { 462 CPUFREQ_NAME_LEN)) {
463 *policy = CPUFREQ_POLICY_POWERSAVE; 463 *policy = CPUFREQ_POLICY_POWERSAVE;
464 err = 0; 464 err = 0;