mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: rusty@rustcorp.com.au
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.5.54 kill module.h compiler warnings
Date: Thu, 2 Jan 2003 16:57:19 +0100 (MET)	[thread overview]
Message-ID: <200301021557.QAA06497@harpo.it.uu.se> (raw)

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 \

             reply	other threads:[~2003-01-02 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-02 15:57 Mikael Pettersson [this message]
2003-01-02 22:54 ` Richard Henderson
2003-01-03  0:01 ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301021557.QAA06497@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®