summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
diff options
context:
space:
mode:
authorJulia Lawall2010-09-05 21:00:20 +0200
committerDave Jones2010-10-22 17:44:47 +0200
commitb2a33c172890b231444803b0bb38c25ac5a0f274 (patch)
tree82c2da16eb7facfccdbdaea0a3b731f57f377081 /arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
parent[CPUFREQ] drivers/cpufreq: Adjust confusing if indentation (diff)
downloadkernel-qcow2-linux-b2a33c172890b231444803b0bb38c25ac5a0f274.tar.gz
kernel-qcow2-linux-b2a33c172890b231444803b0bb38c25ac5a0f274.tar.xz
kernel-qcow2-linux-b2a33c172890b231444803b0bb38c25ac5a0f274.zip
[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/cpufreq-nforce2.c')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 733093d60436..141abebc4516 100644
--- a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
@@ -393,7 +393,7 @@ static struct cpufreq_driver nforce2_driver = {
* Detects nForce2 A2 and C1 stepping
*
*/
-static unsigned int nforce2_detect_chipset(void)
+static int nforce2_detect_chipset(void)
{
nforce2_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA,
PCI_DEVICE_ID_NVIDIA_NFORCE2,