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


Groups > linux.kernel > #1361676 > unrolled thread

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

Started byJiri Kosina <jikos@kernel.org>
First post2016-03-21 11:20 +0100
Last post2016-04-01 02:30 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [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

#1361676 — [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()

FromJiri Kosina <jikos@kernel.org>
Date2016-03-21 11:20 +0100
Subject[PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
Message-ID<rf56h-46T-1@gated-at.bofh.it>
__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

[toc] | [next] | [standalone]


#1366785

FromJiri Kosina <jikos@kernel.org>
Date2016-03-30 01:30 +0200
Message-ID<ribfc-4ZF-11@gated-at.bofh.it>
In reply to#1361676
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 <jkosina@suse.cz>
> ---
> 
> 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

[toc] | [prev] | [next] | [standalone]


#1368897 — Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()

FromRusty Russell <rusty@rustcorp.com.au>
Date2016-04-01 02:30 +0200
SubjectRe: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
Message-ID<riV8m-4z1-3@gated-at.bofh.it>
In reply to#1366785
Jiri Kosina <jikos@kernel.org> writes:
> 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 <jkosina@suse.cz>
>> ---
>> 
>> v1 -> v2: use __noreturn instead of __attribute__((noreturn)) as requested 
>> 	  by Rusty
>
> Rusty, friendly ping on this one.
>
> Thanks!

Oops, I applied it, and in testing noted that lguest had broken and
ended up getting distracted by that.  I've acked it now (it will
probably wait until next merge window).

Thanks,
Rusty.

[toc] | [prev] | [next] | [standalone]


#1369020

FromJiri Kosina <jikos@kernel.org>
Date2016-04-01 08:40 +0200
Message-ID<rj0Uq-qW-7@gated-at.bofh.it>
In reply to#1368897
On Fri, 1 Apr 2016, Rusty Russell 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 <jkosina@suse.cz>
> >> ---
> >> 
> >> v1 -> v2: use __noreturn instead of __attribute__((noreturn)) as requested 
> >> 	  by Rusty
> >
> > Rusty, friendly ping on this one.
> >
> > Thanks!
> 
> Oops, I applied it, and in testing noted that lguest had broken and
> ended up getting distracted by that.  I've acked it now (it will
> probably wait until next merge window).

Sorry, non comprende :) Could you please elaborate? Are you saying this 
patch broke lguest? What is the breakage about?

Thanks,

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1368904 — Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()

FromRusty Russell <rusty@rustcorp.com.au>
Date2016-04-01 02:30 +0200
SubjectRe: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
Message-ID<riV8n-4z1-15@gated-at.bofh.it>
In reply to#1361676
Jiri Kosina <jikos@kernel.org> writes:
> __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>

Applied.

Thanks!
Rusty.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web