public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.5.54 kill module.h compiler warnings
@ 2003-01-02 15:57 Mikael Pettersson
  2003-01-02 22:54 ` Richard Henderson
  2003-01-03  0:01 ` Rusty Russell
  0 siblings, 2 replies; 3+ messages in thread
From: Mikael Pettersson @ 2003-01-02 15:57 UTC (permalink / raw)
  To: rusty; +Cc: linux-kernel

Rusty,

Compiling kernel 2.5.54 with CONFIG_MODULES=n results in
tons and tons of the following warnings:

include/linux/module.h:317: warning: statement with no effect
include/linux/module.h:353: warning: statement with no effect

patch-2.5.54 changed *MOD_INC_USE_COUNT from macros to
__deprecated functions, but also dropped the (void) casts
in front of the try_module_get() calls. Without modules,
try_module_get() is the constant 1, hence the warnings.

The patch below silences the warnings by adding back the
missing (void) casts. Works for me.

/Mikael

--- linux-2.5.54/include/linux/module.h.~1~	2003-01-02 14:27:56.000000000 +0100
+++ linux-2.5.54/include/linux/module.h	2003-01-02 16:39:49.000000000 +0100
@@ -314,7 +314,7 @@
 	/*
 	 * Yes, we ignore the retval here, that's why it's deprecated.
 	 */
-	try_module_get(module);
+	(void)try_module_get(module);
 }
 
 static inline void __deprecated __MOD_DEC_USE_COUNT(struct module *module)
@@ -350,7 +350,7 @@
 	local_inc(&module->ref[get_cpu()].count);
 	put_cpu();
 #else
-	try_module_get(module);
+	(void)try_module_get(module);
 #endif
 }
 #define MOD_INC_USE_COUNT \

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

* Re: [PATCH] 2.5.54 kill module.h compiler warnings
  2003-01-02 15:57 [PATCH] 2.5.54 kill module.h compiler warnings Mikael Pettersson
@ 2003-01-02 22:54 ` Richard Henderson
  2003-01-03  0:01 ` Rusty Russell
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2003-01-02 22:54 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: rusty, linux-kernel

On Thu, Jan 02, 2003 at 04:57:19PM +0100, Mikael Pettersson wrote:
> The patch below silences the warnings by adding back the
> missing (void) casts. Works for me.

Better to make try_module_get a real inline function.


r~

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

* Re: [PATCH] 2.5.54 kill module.h compiler warnings
  2003-01-02 15:57 [PATCH] 2.5.54 kill module.h compiler warnings Mikael Pettersson
  2003-01-02 22:54 ` Richard Henderson
@ 2003-01-03  0:01 ` Rusty Russell
  1 sibling, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2003-01-03  0:01 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel

In message <200301021557.QAA06497@harpo.it.uu.se> you write:
> Rusty,
> 
> Compiling kernel 2.5.54 with CONFIG_MODULES=n results in
> tons and tons of the following warnings:
> 
> include/linux/module.h:317: warning: statement with no effect
> include/linux/module.h:353: warning: statement with no effect
> 
> patch-2.5.54 changed *MOD_INC_USE_COUNT from macros to
> __deprecated functions, but also dropped the (void) casts
> in front of the try_module_get() calls. Without modules,
> try_module_get() is the constant 1, hence the warnings.
> 
> The patch below silences the warnings by adding back the
> missing (void) casts. Works for me.

I know, Christoph Hellwig changed this, and I believe RTH fixed it in
his merge with Linus.

Thanks!
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2003-01-03  4:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-02 15:57 [PATCH] 2.5.54 kill module.h compiler warnings Mikael Pettersson
2003-01-02 22:54 ` Richard Henderson
2003-01-03  0:01 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox