summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <kees.cook@canonical.com>2011-05-04 08:38:56 -0700
committerDave Jones <davej@redhat.com>2011-05-04 11:50:58 -0400
commit1a8e1463a49aaa452da1cefe184a00d4df47f1ef (patch)
treee6f5b1579d37c2255be9b6f83021e443b4a757a7
parent469057d587a9de2cd6087d71a008b908e785a5b6 (diff)
downloadop-kernel-dev-1a8e1463a49aaa452da1cefe184a00d4df47f1ef.zip
op-kernel-dev-1a8e1463a49aaa452da1cefe184a00d4df47f1ef.tar.gz
[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>
-rw-r--r--drivers/cpufreq/cpufreq.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 1e08af4..0a5bea9 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,
t = __find_governor(str_governor);
if (t == NULL) {
- char *name = kasprintf(GFP_KERNEL, "cpufreq_%s",
- str_governor);
+ int ret;
- if (name) {
- int ret;
+ mutex_unlock(&cpufreq_governor_mutex);
+ ret = request_module("cpufreq_%s", str_governor);
+ mutex_lock(&cpufreq_governor_mutex);
- mutex_unlock(&cpufreq_governor_mutex);
- ret = request_module("%s", name);
- mutex_lock(&cpufreq_governor_mutex);
-
- if (ret == 0)
- t = __find_governor(str_governor);
- }
-
- kfree(name);
+ if (ret == 0)
+ t = __find_governor(str_governor);
}
if (t != NULL) {
OpenPOWER on IntegriCloud