x86: coding style fixes to x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
authorPaolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Sat, 14 Jun 2008 19:11:39 +0000 (21:11 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 18 Jun 2008 13:00:14 +0000 (15:00 +0200)
Before:
total: 22 errors, 8 warnings, 440 lines checked

After:
total: 0 errors, 8 warnings, 442 lines checked

paolo@paolo-desktop:~/linux.trees.git$ md5sum /tmp/cpufreq-nforce2.o.*
3d4330a5d188fe904446e5948a618b48  /tmp/cpufreq-nforce2.o.after
1477e6b0dcd6f59b1fb6b4490042eca6  /tmp/cpufreq-nforce2.o.before
^^^ I guess this is because I fixed a few "do not initialise statics to 0 or NULL"

paolo@paolo-desktop:~/linux.trees.git$ size /tmp/cpufreq-nforce2.o.*
   text    data     bss     dec     hex filename
   1923      72      16    2011     7db /tmp/cpufreq-nforce2.o.after
   1923      72      16    2011     7db /tmp/cpufreq-nforce2.o.before

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c

index f03e9153618e52d68f2730f7e7a07e3d9fd71c2b..965ea52767ac65f5059673a3448764103a0e8543 100644 (file)
 #define NFORCE2_SAFE_DISTANCE 50
 
 /* Delay in ms between FSB changes */
-//#define NFORCE2_DELAY 10
+/* #define NFORCE2_DELAY 10 */
 
-/* nforce2_chipset:
+/*
+ * nforce2_chipset:
  * FSB is changed using the chipset
  */
 static struct pci_dev *nforce2_chipset_dev;
@@ -36,13 +37,13 @@ static struct pci_dev *nforce2_chipset_dev;
 /* fid:
  * multiplier * 10
  */
-static int fid = 0;
+static int fid;
 
 /* min_fsb, max_fsb:
  * minimum and maximum FSB (= FSB at boot time)
  */
-static int min_fsb = 0;
-static int max_fsb = 0;
+static int min_fsb;
+static int max_fsb;
 
 MODULE_AUTHOR("Sebastian Witt <se.witt@gmx.net>");
 MODULE_DESCRIPTION("nForce2 FSB changing cpufreq driver");
@@ -53,7 +54,7 @@ module_param(min_fsb, int, 0444);
 
 MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)");
 MODULE_PARM_DESC(min_fsb,
-                 "Minimum FSB to use, if not defined: current FSB - 50");
+               "Minimum FSB to use, if not defined: current FSB - 50");
 
 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg)
 
@@ -139,7 +140,7 @@ static unsigned int nforce2_fsb_read(int bootfsb)
 
        /* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */
        nforce2_sub5 = pci_get_subsys(PCI_VENDOR_ID_NVIDIA,
-                                               0x01EF,PCI_ANY_ID,PCI_ANY_ID,NULL);
+                                               0x01EF, PCI_ANY_ID, PCI_ANY_ID, NULL);
        if (!nforce2_sub5)
                return 0;
 
@@ -147,13 +148,13 @@ static unsigned int nforce2_fsb_read(int bootfsb)
        fsb /= 1000000;
 
        /* Check if PLL register is already set */
-       pci_read_config_byte(nforce2_chipset_dev,NFORCE2_PLLENABLE, (u8 *)&temp);
+       pci_read_config_byte(nforce2_chipset_dev, NFORCE2_PLLENABLE, (u8 *)&temp);
 
-       if(bootfsb || !temp)
+       if (bootfsb || !temp)
                return fsb;
-               
+
        /* Use PLL register FSB value */
-       pci_read_config_dword(nforce2_chipset_dev,NFORCE2_PLLREG, &temp);
+       pci_read_config_dword(nforce2_chipset_dev, NFORCE2_PLLREG, &temp);
        fsb = nforce2_calc_fsb(temp);
 
        return fsb;
@@ -184,7 +185,7 @@ static int nforce2_set_fsb(unsigned int fsb)
        }
 
        /* First write? Then set actual value */
-       pci_read_config_byte(nforce2_chipset_dev,NFORCE2_PLLENABLE, (u8 *)&temp);
+       pci_read_config_byte(nforce2_chipset_dev, NFORCE2_PLLENABLE, (u8 *)&temp);
        if (!temp) {
                pll = nforce2_calc_pll(tfsb);
 
@@ -210,7 +211,8 @@ static int nforce2_set_fsb(unsigned int fsb)
                        tfsb--;
 
                /* Calculate the PLL reg. value */
-               if ((pll = nforce2_calc_pll(tfsb)) == -1)
+               pll = nforce2_calc_pll(tfsb);
+               if (pll == -1)
                        return -EINVAL;
 
                nforce2_write_pll(pll);
@@ -249,7 +251,7 @@ static unsigned int nforce2_get(unsigned int cpu)
 static int nforce2_target(struct cpufreq_policy *policy,
                          unsigned int target_freq, unsigned int relation)
 {
-//        unsigned long         flags;
+/*        unsigned long         flags; */
        struct cpufreq_freqs freqs;
        unsigned int target_fsb;
 
@@ -271,17 +273,17 @@ static int nforce2_target(struct cpufreq_policy *policy,
        cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Disable IRQs */
-       //local_irq_save(flags);
+       /* local_irq_save(flags); */
 
        if (nforce2_set_fsb(target_fsb) < 0)
                printk(KERN_ERR "cpufreq: Changing FSB to %d failed\n",
-                       target_fsb);
+                       target_fsb);
        else
                dprintk("Changed FSB successfully to %d\n",
-                       target_fsb);
+                       target_fsb);
 
        /* Enable IRQs */
-       //local_irq_restore(flags);
+       /* local_irq_restore(flags); */
 
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
@@ -302,8 +304,8 @@ static int nforce2_verify(struct cpufreq_policy *policy)
                policy->max = (fsb_pol_max + 1) * fid * 100;
 
        cpufreq_verify_within_limits(policy,
-                                     policy->cpuinfo.min_freq,
-                                     policy->cpuinfo.max_freq);
+                                    policy->cpuinfo.min_freq,
+                                    policy->cpuinfo.max_freq);
        return 0;
 }
 
@@ -347,7 +349,7 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
        /* Set maximum FSB to FSB at boot time */
        max_fsb = nforce2_fsb_read(1);
 
-       if(!max_fsb)
+       if (!max_fsb)
                return -EIO;
 
        if (!min_fsb)