x86: get rid of checkpatch.pl complains on apm_32.c

This patch eliminates most of code-style errors
discovered by checkpatch.pl on arch/x86/kernel/apm_32.c

no code changed:

      text    data     bss     dec     hex filename
     12142    1837      84   14063    36ef apm_32.o.before
     12142    1837      84   14063    36ef apm_32.o.after

   md5:
       2676b881ad55e387da4a995e8b9ee372  apm_32.o.before.asm
       2676b881ad55e387da4a995e8b9ee372  apm_32.o.after.asm

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Cyrill Gorcunov
2008-01-30 13:32:32 +01:00
committed by Ingo Molnar
parent 1c858087cd
commit 3f4380a1e0

View File

@@ -477,7 +477,8 @@ static void apm_error(char *str, int err)
int i; int i;
for (i = 0; i < ERROR_COUNT; i++) for (i = 0; i < ERROR_COUNT; i++)
if (error_table[i].key == err) break; if (error_table[i].key == err)
break;
if (i < ERROR_COUNT) if (i < ERROR_COUNT)
printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg);
else else
@@ -798,8 +799,7 @@ static int apm_do_idle(void)
/* This always fails on some SMP boards running UP kernels. /* This always fails on some SMP boards running UP kernels.
* Only report the failure the first 5 times. * Only report the failure the first 5 times.
*/ */
if (++t < 5) if (++t < 5) {
{
printk(KERN_DEBUG "apm_do_idle failed (%d)\n", printk(KERN_DEBUG "apm_do_idle failed (%d)\n",
(eax >> 8) & 0xff); (eax >> 8) & 0xff);
t = jiffies; t = jiffies;
@@ -881,7 +881,8 @@ recalc:
t = jiffies; t = jiffies;
switch (apm_do_idle()) { switch (apm_do_idle()) {
case 0: apm_idle_done = 1; case 0:
apm_idle_done = 1;
if (t != jiffies) { if (t != jiffies) {
if (bucket) { if (bucket) {
bucket = IDLE_LEAKY_MAX; bucket = IDLE_LEAKY_MAX;
@@ -892,7 +893,8 @@ recalc:
continue; continue;
} }
break; break;
case 1: apm_idle_done = 1; case 1:
apm_idle_done = 1;
break; break;
default: /* BIOS refused */ default: /* BIOS refused */
break; break;
@@ -934,14 +936,13 @@ static void apm_power_off(void)
}; };
/* Some bioses don't like being called from CPU != 0 */ /* Some bioses don't like being called from CPU != 0 */
if (apm_info.realmode_power_off) if (apm_info.realmode_power_off) {
{
(void)apm_save_cpus(); (void)apm_save_cpus();
machine_real_restart(po_bios_call, sizeof(po_bios_call)); machine_real_restart(po_bios_call, sizeof(po_bios_call));
} } else {
else
(void)set_system_power_state(APM_STATE_OFF); (void)set_system_power_state(APM_STATE_OFF);
} }
}
#ifdef CONFIG_APM_DO_ENABLE #ifdef CONFIG_APM_DO_ENABLE
@@ -1749,17 +1750,35 @@ static int apm(void *unused)
printk(KERN_INFO "apm: power status not available\n"); printk(KERN_INFO "apm: power status not available\n");
else { else {
switch ((bx >> 8) & 0xff) { switch ((bx >> 8) & 0xff) {
case 0: power_stat = "off line"; break; case 0:
case 1: power_stat = "on line"; break; power_stat = "off line";
case 2: power_stat = "on backup power"; break; break;
default: power_stat = "unknown"; break; case 1:
power_stat = "on line";
break;
case 2:
power_stat = "on backup power";
break;
default:
power_stat = "unknown";
break;
} }
switch (bx & 0xff) { switch (bx & 0xff) {
case 0: bat_stat = "high"; break; case 0:
case 1: bat_stat = "low"; break; bat_stat = "high";
case 2: bat_stat = "critical"; break; break;
case 3: bat_stat = "charging"; break; case 1:
default: bat_stat = "unknown"; break; bat_stat = "low";
break;
case 2:
bat_stat = "critical";
break;
case 3:
bat_stat = "charging";
break;
default:
bat_stat = "unknown";
break;
} }
printk(KERN_INFO printk(KERN_INFO
"apm: AC %s, battery status %s, battery life ", "apm: AC %s, battery status %s, battery life ",
@@ -1827,8 +1846,7 @@ static int __init apm_setup(char *str)
if ((strncmp(str, "power-off", 9) == 0) || if ((strncmp(str, "power-off", 9) == 0) ||
(strncmp(str, "power_off", 9) == 0)) (strncmp(str, "power_off", 9) == 0))
power_off = !invert; power_off = !invert;
if (strncmp(str, "smp", 3) == 0) if (strncmp(str, "smp", 3) == 0) {
{
smp = !invert; smp = !invert;
idle_threshold = 100; idle_threshold = 100;
} }
@@ -1880,7 +1898,8 @@ static int __init print_if_true(const struct dmi_system_id *d)
*/ */
static int __init broken_ps2_resume(const struct dmi_system_id *d) static int __init broken_ps2_resume(const struct dmi_system_id *d)
{ {
printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident); printk(KERN_INFO "%s machine detected. Mousepad Resume Bug "
"workaround hopefully not needed.\n", d->ident);
return 0; return 0;
} }
@@ -1889,7 +1908,8 @@ static int __init set_realmode_power_off(const struct dmi_system_id *d)
{ {
if (apm_info.realmode_power_off == 0) { if (apm_info.realmode_power_off == 0) {
apm_info.realmode_power_off = 1; apm_info.realmode_power_off = 1;
printk(KERN_INFO "%s bios detected. Using realmode poweroff only.\n", d->ident); printk(KERN_INFO "%s bios detected. "
"Using realmode poweroff only.\n", d->ident);
} }
return 0; return 0;
} }
@@ -1899,7 +1919,8 @@ static int __init set_apm_ints(const struct dmi_system_id *d)
{ {
if (apm_info.allow_ints == 0) { if (apm_info.allow_ints == 0) {
apm_info.allow_ints = 1; apm_info.allow_ints = 1;
printk(KERN_INFO "%s machine detected. Enabling interrupts during APM calls.\n", d->ident); printk(KERN_INFO "%s machine detected. "
"Enabling interrupts during APM calls.\n", d->ident);
} }
return 0; return 0;
} }
@@ -1909,7 +1930,8 @@ static int __init apm_is_horked(const struct dmi_system_id *d)
{ {
if (apm_info.disabled == 0) { if (apm_info.disabled == 0) {
apm_info.disabled = 1; apm_info.disabled = 1;
printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident); printk(KERN_INFO "%s machine detected. "
"Disabling APM.\n", d->ident);
} }
return 0; return 0;
} }
@@ -1918,7 +1940,8 @@ static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
{ {
if (apm_info.disabled == 0) { if (apm_info.disabled == 0) {
apm_info.disabled = 1; apm_info.disabled = 1;
printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident); printk(KERN_INFO "%s machine detected. "
"Disabling APM.\n", d->ident);
printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n"); printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
printk(KERN_INFO "download from support.intel.com \n"); printk(KERN_INFO "download from support.intel.com \n");
} }
@@ -1930,7 +1953,8 @@ static int __init apm_likes_to_melt(const struct dmi_system_id *d)
{ {
if (apm_info.forbid_idle == 0) { if (apm_info.forbid_idle == 0) {
apm_info.forbid_idle = 1; apm_info.forbid_idle = 1;
printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident); printk(KERN_INFO "%s machine detected. "
"Disabling APM idle calls.\n", d->ident);
} }
return 0; return 0;
} }
@@ -1953,7 +1977,8 @@ static int __init apm_likes_to_melt(const struct dmi_system_id *d)
static int __init broken_apm_power(const struct dmi_system_id *d) static int __init broken_apm_power(const struct dmi_system_id *d)
{ {
apm_info.get_power_status_broken = 1; apm_info.get_power_status_broken = 1;
printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n"); printk(KERN_WARNING "BIOS strings suggest APM bugs, "
"disabling power status reporting.\n");
return 0; return 0;
} }
@@ -1964,7 +1989,8 @@ static int __init broken_apm_power(const struct dmi_system_id *d)
static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d) static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
{ {
apm_info.get_power_status_swabinminutes = 1; apm_info.get_power_status_swabinminutes = 1;
printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n"); printk(KERN_WARNING "BIOS strings suggest APM reports battery life "
"in minutes and wrong byte order.\n");
return 0; return 0;
} }