X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Fpdc_chassis.c;h=a45e2e2ffd9f7ff21c2caf748b9e8ce01aa210ce;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=7268abfcd43df263a4fb57e8a44ffd793154485c;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c index 7268abfcd..a45e2e2ff 100644 --- a/arch/parisc/kernel/pdc_chassis.c +++ b/arch/parisc/kernel/pdc_chassis.c @@ -2,12 +2,11 @@ * interfaces to log Chassis Codes via PDC (firmware) * * Copyright (C) 2002 Laurent Canet - * Copyright (C) 2002-2004 Thibaut VARENE + * Copyright (C) 2002-2004 Thibaut VARENE * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -30,6 +29,7 @@ #include #include #include +#include #include #include @@ -38,8 +38,8 @@ #ifdef CONFIG_PDC_CHASSIS -static int pdc_chassis_old = 0; -static unsigned int pdc_chassis_enabled = 1; +static int pdc_chassis_old __read_mostly = 0; +static unsigned int pdc_chassis_enabled __read_mostly = 1; /** @@ -132,7 +132,7 @@ void __init parisc_pdc_chassis_init(void) { #ifdef CONFIG_PDC_CHASSIS int handle = 0; - if (pdc_chassis_enabled) { + if (likely(pdc_chassis_enabled)) { DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__); /* Let see if we have something to handle... */ @@ -142,14 +142,15 @@ void __init parisc_pdc_chassis_init(void) printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n"); handle = 1; } - else if (pdc_chassis_old) { + else if (unlikely(pdc_chassis_old)) { printk(KERN_INFO "Enabling old style chassis LED panel support.\n"); handle = 1; } if (handle) { /* initialize panic notifier chain */ - notifier_chain_register(&panic_notifier_list, &pdc_chassis_panic_block); + atomic_notifier_chain_register(&panic_notifier_list, + &pdc_chassis_panic_block); /* initialize reboot notifier chain */ register_reboot_notifier(&pdc_chassis_reboot_block); @@ -178,11 +179,11 @@ int pdc_chassis_send_status(int message) /* Maybe we should do that in an other way ? */ int retval = 0; #ifdef CONFIG_PDC_CHASSIS - if (pdc_chassis_enabled) { + if (likely(pdc_chassis_enabled)) { DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message); -#ifdef CONFIG_PARISC64 +#ifdef CONFIG_64BIT if (is_pdc_pat()) { switch(message) { case PDC_CHASSIS_DIRECT_BSTART: @@ -214,7 +215,7 @@ int pdc_chassis_send_status(int message) } } else retval = -1; #else - if (pdc_chassis_old) { + if (unlikely(pdc_chassis_old)) { switch (message) { case PDC_CHASSIS_DIRECT_BSTART: case PDC_CHASSIS_DIRECT_BCOMPLETE: @@ -238,7 +239,7 @@ int pdc_chassis_send_status(int message) retval = -1; } } else retval = -1; -#endif /* CONFIG_PARISC64 */ +#endif /* CONFIG_64BIT */ } /* if (pdc_chassis_enabled) */ #endif /* CONFIG_PDC_CHASSIS */ return retval;