diff options
author | Kees Cook <kees.cook@canonical.com> | 2011-05-04 11:38:56 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-05-04 11:50:58 -0400 |
commit | 1a8e1463a49aaa452da1cefe184a00d4df47f1ef (patch) | |
tree | e6f5b1579d37c2255be9b6f83021e443b4a757a7 /drivers/cpufreq/cpufreq.c | |
parent | 469057d587a9de2cd6087d71a008b908e785a5b6 (diff) |
[CPUFREQ] remove redundant sprintf from request_module call.
Since format string handling is part of request_module, there is no
need to construct the module name. As such, drop the redundant sprintf
and heap usage.
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1e08af43ae72..0a5bea9e3585 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -321,21 +321,14 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy, | |||
321 | t = __find_governor(str_governor); | 321 | t = __find_governor(str_governor); |
322 | 322 | ||
323 | if (t == NULL) { | 323 | if (t == NULL) { |
324 | char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", | 324 | int ret; |
325 | str_governor); | ||
326 | 325 | ||
327 | if (name) { | 326 | mutex_unlock(&cpufreq_governor_mutex); |
328 | int ret; | 327 | ret = request_module("cpufreq_%s", str_governor); |
328 | mutex_lock(&cpufreq_governor_mutex); | ||
329 | 329 | ||
330 | mutex_unlock(&cpufreq_governor_mutex); | 330 | if (ret == 0) |
331 | ret = request_module("%s", name); | 331 | t = __find_governor(str_governor); |
332 | mutex_lock(&cpufreq_governor_mutex); | ||
333 | |||
334 | if (ret == 0) | ||
335 | t = __find_governor(str_governor); | ||
336 | } | ||
337 | |||
338 | kfree(name); | ||
339 | } | 332 | } |
340 | 333 | ||
341 | if (t != NULL) { | 334 | if (t != NULL) { |