linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/i386/kernel/nmi.c: fix compiler warning
@ 2006-01-26 20:33 Lee Revell
  2006-01-26 21:08 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Revell @ 2006-01-26 20:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

arch/i386/kernel/nmi.c: In function 'check_nmi_watchdog':
arch/i386/kernel/nmi.c:139: warning: statement with no effect

Signed-Off-By: Lee Revell <rlrevell@joe-job.com>

--- linux-2.6.16-rc1/arch/i386/kernel/nmi.c~	2006-01-17 02:44:47.000000000 -0500
+++ linux-2.6.16-rc1/arch/i386/kernel/nmi.c	2006-01-26 15:30:59.000000000 -0500
@@ -135,8 +135,10 @@
 
 	printk(KERN_INFO "Testing NMI watchdog ... ");
 
+#ifdef CONFIG_SMP
 	if (nmi_watchdog == NMI_LOCAL_APIC)
 		smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
+#endif
 
 	for (cpu = 0; cpu < NR_CPUS; cpu++)
 		prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: arch/i386/kernel/nmi.c: fix compiler warning
  2006-01-26 20:33 arch/i386/kernel/nmi.c: fix compiler warning Lee Revell
@ 2006-01-26 21:08 ` Joe Perches
  2006-01-27 23:34   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2006-01-26 21:08 UTC (permalink / raw)
  To: Lee Revell; +Cc: linux-kernel, Andrew Morton

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)



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: arch/i386/kernel/nmi.c: fix compiler warning
  2006-01-26 21:08 ` Joe Perches
@ 2006-01-27 23:34   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2006-01-27 23:34 UTC (permalink / raw)
  To: Joe Perches; +Cc: rlrevell, linux-kernel

Joe Perches <joe@perches.com> wrote:
>
> --- 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;
> +}

I think we tried this before and it broke things.  Because there are
callback functions which are inside CONFIG_SMP.  With the macro, they don't
get referred to at all.  Wth the inline, the compiler needs to see their
definition and errors out.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-27 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 20:33 arch/i386/kernel/nmi.c: fix compiler warning Lee Revell
2006-01-26 21:08 ` Joe Perches
2006-01-27 23:34   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).