Commit bf262dce authored by Jiri Kosina's avatar Jiri Kosina Committed by Rusty Russell

module: fix noreturn attribute for __module_put_and_exit()

__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: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 3fc9d690
...@@ -575,8 +575,8 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, ...@@ -575,8 +575,8 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
struct module *, unsigned long), struct module *, unsigned long),
void *data); void *data);
extern void __module_put_and_exit(struct module *mod, long code) extern void __noreturn __module_put_and_exit(struct module *mod,
__attribute__((noreturn)); long code);
#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
#ifdef CONFIG_MODULE_UNLOAD #ifdef CONFIG_MODULE_UNLOAD
......
...@@ -336,7 +336,7 @@ static inline void add_taint_module(struct module *mod, unsigned flag, ...@@ -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 * 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. * 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); module_put(mod);
do_exit(code); do_exit(code);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment