]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
module: fix noreturn attribute for __module_put_and_exit()
authorJiri Kosina <jikos@kernel.org>
Mon, 11 Apr 2016 19:32:09 +0000 (05:02 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 27 Jul 2016 03:08:00 +0000 (12:38 +0930)
__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>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/module.h
kernel/module.c

index 3daf2b3a09d29b934a865be849dab354bd00dde0..f777164c238b5a73ca922575236c4a7e9ff5180d 100644 (file)
@@ -575,8 +575,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
index 5f71aa63ed2a55e3dda3c00066ba4d61f3f68177..5e876977844bbba1fb89af8679c98a4233fa8b9c 100644 (file)
@@ -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);