Re: arch/i386/kernel/nmi.c: fix compiler warning

From: Joe Perches
Date: Thu Jan 26 2006 - 16:06:41 EST


On Thu, 2006-01-26 at 15:33 -0500, Lee Revell wrote:
> arch/i386/kernel/nmi.c: In function 'check_nmi_watchdog':
> arch/i386/kernel/nmi.c:139: warning: statement with no effect

A more generic solution:

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9dfa3ee..be4e598 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -90,12 +90,25 @@ void smp_prepare_boot_cpu(void);
#else /* !SMP */

/*
- * These macros fold the SMP functionality into a single CPU system
+ * These macros and inlines fold the SMP functionality
+ * for single CPU systems
*/
#define raw_smp_processor_id() 0
#define hard_smp_processor_id() 0
-#define smp_call_function(func,info,retry,wait) ({ 0; })
-#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
+
+static inline int smp_call_function(void (*func) (void *info), void *info,
+ int retry, int wait)
+{
+ return 0;
+}
+
+static inline int on_each_cpu(void (*func) (void *info), void *info,
+ int retry, int wait)
+{
+ func(info);
+ return 0;
+}
+
static inline void smp_send_reschedule(int cpu) { }
#define num_booting_cpus() 1
#define smp_prepare_boot_cpu() do {} while (0)


-
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/