Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450AbcC2X3J (ORCPT ); Tue, 29 Mar 2016 19:29:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:40832 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932205AbcC2X3I (ORCPT ); Tue, 29 Mar 2016 19:29:08 -0400 Date: Wed, 30 Mar 2016 01:29:05 +0200 (CEST) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Rusty Russell cc: linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit() In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1882 Lines: 58 On Mon, 21 Mar 2016, Jiri Kosina wrote: > __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 > --- > > v1 -> v2: use __noreturn instead of __attribute__((noreturn)) as requested > by Rusty Rusty, friendly ping on this one. Thanks! > > 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 > -- Jiri Kosina SUSE Labs