diff options
author | Julia Lawall <julia@diku.dk> | 2010-09-05 15:00:20 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2010-10-22 11:44:47 -0400 |
commit | b2a33c172890b231444803b0bb38c25ac5a0f274 (patch) | |
tree | 82c2da16eb7facfccdbdaea0a3b731f57f377081 /arch/x86/kernel/cpu/cpufreq/longrun.c | |
parent | bec037aa6ccb5d561c880e369c409a1b28da5eb4 (diff) |
[CPUFREQ] arch/x86/kernel/cpu/cpufreq: Fix unsigned return type
In each case, the function has an unsigned return type, but returns a
negative constant to indicate an error condition. Each function is only
called once. For nforce2_detect_chipset, the result is only compared to 0,
and for longrun_determine_freqs, the result is stored in a variable of type
(signed) int. Thus, for both functions, unsigned can be dropped from the
return type.
A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@exists@
identifier f;
constant C;
@@
unsigned f(...)
{ <+...
* return -C;
...+> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/longrun.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c index fc09f142d94d..77945bfbded2 100644 --- a/arch/x86/kernel/cpu/cpufreq/longrun.c +++ b/arch/x86/kernel/cpu/cpufreq/longrun.c | |||
@@ -165,7 +165,7 @@ static unsigned int longrun_get(unsigned int cpu) | |||
165 | * TMTA rules: | 165 | * TMTA rules: |
166 | * performance_pctg = (target_freq - low_freq)/(high_freq - low_freq) | 166 | * performance_pctg = (target_freq - low_freq)/(high_freq - low_freq) |
167 | */ | 167 | */ |
168 | static unsigned int __cpuinit longrun_determine_freqs(unsigned int *low_freq, | 168 | static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, |
169 | unsigned int *high_freq) | 169 | unsigned int *high_freq) |
170 | { | 170 | { |
171 | u32 msr_lo, msr_hi; | 171 | u32 msr_lo, msr_hi; |