Skip to content

Commit

Permalink
[CPUFREQ] Coding style fixes to arch/x86/kernel/cpu/cpufreq/elanfreq.c
Browse files Browse the repository at this point in the history
Before:
total: 15 errors, 10 warnings, 308 lines checked

After:
total: 0 errors, 4 warnings, 308 lines checked

paolo@paolo-desktop:~/linux.trees.git$ md5sum /tmp/elafreq.o.*
add1d36c2f077c5aab7682e8642a9f34  /tmp/elafreq.o.after
add1d36c2f077c5aab7682e8642a9f34  /tmp/elafreq.o.before

paolo@paolo-desktop:~/linux.trees.git$ size /tmp/elafreq.o.*
   text    data     bss     dec     hex filename
    934     270       4    1208     4b8 /tmp/elafreq.o.after
    934     270       4    1208     4b8 /tmp/elafreq.o.before

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Paolo Ciarrocchi authored and Dave Jones committed Oct 9, 2008
1 parent 6984937 commit 18c6faa
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions arch/x86/kernel/cpu/cpufreq/elanfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <linux/cpufreq.h>

#include <asm/msr.h>
#include <asm/timex.h>
#include <asm/io.h>
#include <linux/timex.h>
#include <linux/io.h>

#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */
#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */
Expand Down Expand Up @@ -82,7 +82,7 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
u8 clockspeed_reg; /* Clock Speed Register */

local_irq_disable();
outb_p(0x80,REG_CSCIR);
outb_p(0x80, REG_CSCIR);
clockspeed_reg = inb_p(REG_CSCDR);
local_irq_enable();

Expand All @@ -98,10 +98,10 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
}

/* 33 MHz is not 32 MHz... */
if ((clockspeed_reg & 0xE0)==0xA0)
if ((clockspeed_reg & 0xE0) == 0xA0)
return 33000;

return ((1<<((clockspeed_reg & 0xE0) >> 5)) * 1000);
return (1<<((clockspeed_reg & 0xE0) >> 5)) * 1000;
}


Expand All @@ -117,7 +117,7 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
* There is no return value.
*/

static void elanfreq_set_cpu_state (unsigned int state)
static void elanfreq_set_cpu_state(unsigned int state)
{
struct cpufreq_freqs freqs;

Expand All @@ -144,20 +144,20 @@ static void elanfreq_set_cpu_state (unsigned int state)
*/

local_irq_disable();
outb_p(0x40,REG_CSCIR); /* Disable hyperspeed mode */
outb_p(0x00,REG_CSCDR);
outb_p(0x40, REG_CSCIR); /* Disable hyperspeed mode */
outb_p(0x00, REG_CSCDR);
local_irq_enable(); /* wait till internal pipelines and */
udelay(1000); /* buffers have cleaned up */

local_irq_disable();

/* now, set the CPU clock speed register (0x80) */
outb_p(0x80,REG_CSCIR);
outb_p(elan_multiplier[state].val80h,REG_CSCDR);
outb_p(0x80, REG_CSCIR);
outb_p(elan_multiplier[state].val80h, REG_CSCDR);

/* now, the hyperspeed bit in PMU Force Mode Register (0x40) */
outb_p(0x40,REG_CSCIR);
outb_p(elan_multiplier[state].val40h,REG_CSCDR);
outb_p(0x40, REG_CSCIR);
outb_p(elan_multiplier[state].val40h, REG_CSCDR);
udelay(10000);
local_irq_enable();

Expand All @@ -173,12 +173,12 @@ static void elanfreq_set_cpu_state (unsigned int state)
* for the hardware supported by the driver.
*/

static int elanfreq_verify (struct cpufreq_policy *policy)
static int elanfreq_verify(struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, &elanfreq_table[0]);
}

static int elanfreq_target (struct cpufreq_policy *policy,
static int elanfreq_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
Expand All @@ -205,15 +205,15 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)

/* capability check */
if ((c->x86_vendor != X86_VENDOR_AMD) ||
(c->x86 != 4) || (c->x86_model!=10))
(c->x86 != 4) || (c->x86_model != 10))
return -ENODEV;

/* max freq */
if (!max_freq)
max_freq = elanfreq_get_cpu_frequency(0);

/* table init */
for (i=0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
for (i = 0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (elanfreq_table[i].frequency > max_freq)
elanfreq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
}
Expand All @@ -224,7 +224,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)

result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table);
if (result)
return (result);
return result;

cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
return 0;
Expand Down Expand Up @@ -260,7 +260,7 @@ __setup("elanfreq=", elanfreq_setup);
#endif


static struct freq_attr* elanfreq_attr[] = {
static struct freq_attr *elanfreq_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
Expand All @@ -284,9 +284,9 @@ static int __init elanfreq_init(void)

/* Test if we have the right hardware */
if ((c->x86_vendor != X86_VENDOR_AMD) ||
(c->x86 != 4) || (c->x86_model!=10)) {
(c->x86 != 4) || (c->x86_model != 10)) {
printk(KERN_INFO "elanfreq: error: no Elan processor found!\n");
return -ENODEV;
return -ENODEV;
}
return cpufreq_register_driver(&elanfreq_driver);
}
Expand All @@ -298,7 +298,7 @@ static void __exit elanfreq_exit(void)
}


module_param (max_freq, int, 0444);
module_param(max_freq, int, 0444);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Robert Schwebel <r.schwebel@pengutronix.de>, Sven Geggus <sven@geggus.net>");
Expand Down

0 comments on commit 18c6faa

Please sign in to comment.