From: Jiri Kosina <jikos@kernel.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
Date: Mon, 21 Mar 2016 11:13:53 +0100 (CET) [thread overview]
Message-ID: <alpine.LNX.2.00.1603211113030.3656@cbobk.fhfr.pm> (raw)
In-Reply-To: <alpine.LNX.2.00.1603170957540.3656@cbobk.fhfr.pm>
__module_put_and_exit() is makred noreturn in module.h declaration, but is
lacking the attribute in the definition, which makes some tools (such as
sparse) unhappy. Amend the definition with the attribute as well (and
reformat the declaration so that it uses more common format).
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
v1 -> v2: use __noreturn instead of __attribute__((noreturn)) as requested
by Rusty
include/linux/module.h | 4 ++--
kernel/module.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index 2bb0c30..17a13ec 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -562,8 +562,8 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
struct module *, unsigned long),
void *data);
-extern void __module_put_and_exit(struct module *mod, long code)
- __attribute__((noreturn));
+extern void __noreturn __module_put_and_exit(struct module *mod,
+ long code);
#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
#ifdef CONFIG_MODULE_UNLOAD
diff --git a/kernel/module.c b/kernel/module.c
index 041200c..d367ba0 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -336,7 +336,7 @@ static inline void add_taint_module(struct module *mod, unsigned flag,
* A thread that wants to hold a reference to a module only while it
* is running can call this to safely exit. nfsd and lockd use this.
*/
-void __module_put_and_exit(struct module *mod, long code)
+void __noreturn __module_put_and_exit(struct module *mod, long code)
{
module_put(mod);
do_exit(code);
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2016-03-21 10:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 8:59 [PATCH] module: fix noreturn attribute for __module_put_and_exit() Jiri Kosina
2016-03-18 2:48 ` Rusty Russell
2016-03-21 10:13 ` Jiri Kosina [this message]
2016-03-29 23:29 ` [PATCH v2] " Jiri Kosina
2016-03-31 23:54 ` Rusty Russell
2016-04-01 6:31 ` Jiri Kosina
2016-04-06 5:22 ` Jiri Kosina
2016-04-12 7:30 ` Rusty Russell
2016-03-31 23:53 ` 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=alpine.LNX.2.00.1603211113030.3656@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=akpm@linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).