[PATCH]fix warning in porting lockless mce from x86_64 to i386

From: Guo, Racing
Date: Wed Apr 27 2005 - 21:26:48 EST


Fix warning in porting lockless mce from x86_64 to i386
1. fix warning in set_bit
2. declare mcheck_init function
3. change to "fastcall" before do_machine_check

Signed-off-by: Guo, Racing <racing.guo@xxxxxxxxx>
---

mce.c | 14 +++++++-------
mce.h | 1 +
2 files changed, 8 insertions(+), 7 deletions(-)

diff -rNu
linux-2.6.11.6-move-files-mce/arch/i386/kernel/cpu/mcheck/mce.c
linux-2.6.11.6-move-files-mce-fix/arch/i386/kernel/cpu/mcheck/mce.c
--- linux-2.6.11.6-move-files-mce/arch/i386/kernel/cpu/mcheck/mce.c
2005-04-27 13:58:33.000000000 +0800
+++ linux-2.6.11.6-move-files-mce-fix/arch/i386/kernel/cpu/mcheck/mce.c
2005-04-28 10:02:09.386327560 +0800
@@ -56,7 +56,12 @@
/* When the buffer fills up discard new entries. Assume
that the earlier errors are the more interesting. */
if (entry >= MCE_LOG_LEN) {
- set_bit(MCE_OVERFLOW, &mcelog.flags);
+ /* cast &mcelog.flags to (unsigned long *) in
order
+ to prevent compiler warning. It is OK to cast
+ (unsigned *) to (unsigned long *) in set_bit
on
+ little-endian machine
+ */
+ set_bit(MCE_OVERFLOW, (unsigned long
*)&mcelog.flags);
return;
}
/* Old left over entry. Skip. */
@@ -131,12 +136,7 @@
/*
* The actual machine check handler
*/
-#ifdef CONFIG_X86_64
-asmlinkage
-#else
-fastcall
-#endif
-void do_machine_check(struct pt_regs * regs, long error_code)
+fastcall void do_machine_check(struct pt_regs * regs, long error_code)
{
struct mce m, panicm;
int nowayout = (tolerant < 1);
diff -rNu
linux-2.6.11.6-move-files-mce/arch/i386/kernel/cpu/mcheck/mce.h
linux-2.6.11.6-move-files-mce-fix/arch/i386/kernel/cpu/mcheck/mce.h
--- linux-2.6.11.6-move-files-mce/arch/i386/kernel/cpu/mcheck/mce.h
2005-04-12 17:29:57.000000000 +0800
+++ linux-2.6.11.6-move-files-mce-fix/arch/i386/kernel/cpu/mcheck/mce.h
2005-04-28 10:02:09.386327560 +0800
@@ -68,6 +68,7 @@
#define MCE_EXTENDED_BANK 128
#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0

+void __init mcheck_init(struct cpuinfo_x86 *c);
void mce_log(struct mce *m);
#ifdef CONFIG_X86_MCE_INTEL
void mce_intel_feature_init(struct cpuinfo_x86 *c);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/