Skip to contentSkip to conversation

cpufreq: remove the unnecessary initialization of a local variable

PATCH Applied Jingoo Han 2 participants 2 messages Oct 31, 2012 – Nov 2, 2012 CPU frequency scaling framework

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 cpufreq: remove the unnecessary initialization of a local variable

This patch removes unnecessary initializer for the 'ret' variable.

---
 drivers/cpufreq/cpufreq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +2 -2
index 261ef65..4e9fcc5 100644
@@ -404,7 +404,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
 static ssize_t store_##file_name					\
 (struct cpufreq_policy *policy, const char *buf, size_t count)		\
 {									\
-	unsigned int ret = -EINVAL;					\
+	unsigned int ret;						\
 	struct cpufreq_policy new_policy;				\
 									\
 	ret = cpufreq_get_policy(&new_policy, policy->cpu);		\
@@ -459,7 +459,7 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
 static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
 					const char *buf, size_t count)
 {
-	unsigned int ret = -EINVAL;
+	unsigned int ret;
 	char	str_governor[16];
 	struct cpufreq_policy new_policy;
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 1 line · Jingoo Han

This patch removes unnecessary initializer for the 'ret' variable.

Applied to the linux-next branch of the linux-pm.git tree as v3.8 material.

Thanks,
Rafael

Quoted 28 lines
---
 drivers/cpufreq/cpufreq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +2 -2
index 261ef65..4e9fcc5 100644
@@ -404,7 +404,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
 static ssize_t store_##file_name					\
 (struct cpufreq_policy *policy, const char *buf, size_t count)		\
 {									\
-	unsigned int ret = -EINVAL;					\
+	unsigned int ret;						\
 	struct cpufreq_policy new_policy;				\
 									\
 	ret = cpufreq_get_policy(&new_policy, policy->cpu);		\
@@ -459,7 +459,7 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
 static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
 					const char *buf, size_t count)
 {
-	unsigned int ret = -EINVAL;
+	unsigned int ret;
 	char	str_governor[16];
 	struct cpufreq_policy new_policy;
 
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.