Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359640

[PATCH] module: fix noreturn attribute for __module_put_and_exit()

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject [PATCH] module: fix noreturn attribute for __module_put_and_exit()
Date 2016-03-17 10:00 +0100
Message-ID <rdBWH-50M-31@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


__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>
---
 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..4cd52b5 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 __attribute__((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 794ebe8..61f56c2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -335,7 +335,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 __attribute__((noreturn)) __module_put_and_exit(struct module *mod, long code)
 {
 	module_put(mod);
 	do_exit(code);

-- 
Jiri Kosina
SUSE Labs

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] module: fix noreturn attribute for __module_put_and_exit() Jiri Kosina <jikos@kernel.org> - 2016-03-17 10:00 +0100
  Re: [PATCH] module: fix noreturn attribute for __module_put_and_exit() Rusty Russell <rusty@rustcorp.com.au> - 2016-03-19 10:30 +0100
  [PATCH v2] module: fix noreturn attribute for  __module_put_and_exit() Jiri Kosina <jikos@kernel.org> - 2016-03-21 11:20 +0100
    Re: [PATCH v2] module: fix noreturn attribute for  __module_put_and_exit() Jiri Kosina <jikos@kernel.org> - 2016-03-30 01:30 +0200
      Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit() Rusty Russell <rusty@rustcorp.com.au> - 2016-04-01 02:30 +0200
        Re: [PATCH v2] module: fix noreturn attribute for  __module_put_and_exit() Jiri Kosina <jikos@kernel.org> - 2016-04-01 08:40 +0200
    Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit() Rusty Russell <rusty@rustcorp.com.au> - 2016-04-01 02:30 +0200

csiph-web