]> git.karo-electronics.de Git - mv-sheeva.git/commit
[CPUFREQ] arch/x86/kernel/cpu/cpufreq: Fix unsigned return type
authorJulia Lawall <julia@diku.dk>
Sun, 5 Sep 2010 19:00:20 +0000 (21:00 +0200)
committerDave Jones <davej@redhat.com>
Fri, 22 Oct 2010 15:44:47 +0000 (11:44 -0400)
commitb2a33c172890b231444803b0bb38c25ac5a0f274
tree82c2da16eb7facfccdbdaea0a3b731f57f377081
parentbec037aa6ccb5d561c880e369c409a1b28da5eb4
[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>
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
arch/x86/kernel/cpu/cpufreq/longrun.c