cpufreq: Use signed type for 'ret' variable, to store negative error values
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Fri, 6 Sep 2013 19:54:06 +0000 (01:24 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Sep 2013 00:49:48 +0000 (02:49 +0200)
There are places where the variable 'ret' is declared as unsigned int
and then used to store negative return values such as -EINVAL. Fix them
by declaring the variable as a signed quantity.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index 2863214c5381a7c7f5dbf9c2eb97a3a7d8552976..73d53d5a16eee91b94bdc6ca75efae32f13db161 100644 (file)
@@ -437,7 +437,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *policy,
 static ssize_t store_##file_name                                       \
 (struct cpufreq_policy *policy, const char *buf, size_t count)         \
 {                                                                      \
-       unsigned int ret;                                               \
+       int ret;                                                        \
        struct cpufreq_policy new_policy;                               \
                                                                        \
        ret = cpufreq_get_policy(&new_policy, policy->cpu);             \
@@ -490,7 +490,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;
+       int ret;
        char    str_governor[16];
        struct cpufreq_policy new_policy;