linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module: fix noreturn attribute for __module_put_and_exit()
@ 2016-03-17  8:59 Jiri Kosina
  2016-03-18  2:48 ` Rusty Russell
  2016-03-21 10:13 ` [PATCH v2] " Jiri Kosina
  0 siblings, 2 replies; 9+ messages in thread
From: Jiri Kosina @ 2016-03-17  8:59 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Andrew Morton

__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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-17  8:59 [PATCH] module: fix noreturn attribute for __module_put_and_exit() Jiri Kosina
@ 2016-03-18  2:48 ` Rusty Russell
  2016-03-21 10:13 ` [PATCH v2] " Jiri Kosina
  1 sibling, 0 replies; 9+ messages in thread
From: Rusty Russell @ 2016-03-18  2:48 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Andrew Morton

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>

Hi Jiri,

        While I'm not sure we shouldn't just fix sparse, we should also
use __noreturn.

Cheers,
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..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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-17  8:59 [PATCH] module: fix noreturn attribute for __module_put_and_exit() Jiri Kosina
  2016-03-18  2:48 ` Rusty Russell
@ 2016-03-21 10:13 ` Jiri Kosina
  2016-03-29 23:29   ` Jiri Kosina
  2016-03-31 23:53   ` Rusty Russell
  1 sibling, 2 replies; 9+ messages in thread
From: Jiri Kosina @ 2016-03-21 10:13 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Andrew Morton

__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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-21 10:13 ` [PATCH v2] " Jiri Kosina
@ 2016-03-29 23:29   ` Jiri Kosina
  2016-03-31 23:54     ` Rusty Russell
  2016-04-06  5:22     ` Jiri Kosina
  2016-03-31 23:53   ` Rusty Russell
  1 sibling, 2 replies; 9+ messages in thread
From: Jiri Kosina @ 2016-03-29 23:29 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-21 10:13 ` [PATCH v2] " Jiri Kosina
  2016-03-29 23:29   ` Jiri Kosina
@ 2016-03-31 23:53   ` Rusty Russell
  1 sibling, 0 replies; 9+ messages in thread
From: Rusty Russell @ 2016-03-31 23:53 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Andrew Morton

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-29 23:29   ` Jiri Kosina
@ 2016-03-31 23:54     ` Rusty Russell
  2016-04-01  6:31       ` Jiri Kosina
  2016-04-06  5:22     ` Jiri Kosina
  1 sibling, 1 reply; 9+ messages in thread
From: Rusty Russell @ 2016-03-31 23:54 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Andrew Morton

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-31 23:54     ` Rusty Russell
@ 2016-04-01  6:31       ` Jiri Kosina
  0 siblings, 0 replies; 9+ messages in thread
From: Jiri Kosina @ 2016-04-01  6:31 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-03-29 23:29   ` Jiri Kosina
  2016-03-31 23:54     ` Rusty Russell
@ 2016-04-06  5:22     ` Jiri Kosina
  2016-04-12  7:30       ` Rusty Russell
  1 sibling, 1 reply; 9+ messages in thread
From: Jiri Kosina @ 2016-04-06  5:22 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Andrew Morton

On Wed, 30 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.

Not seeing this in your tree, let me send another friendly ping :)

Rusty, if you want me to take this through trivial.git, just let me know, 
I'll happily do it.

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] module: fix noreturn attribute for __module_put_and_exit()
  2016-04-06  5:22     ` Jiri Kosina
@ 2016-04-12  7:30       ` Rusty Russell
  0 siblings, 0 replies; 9+ messages in thread
From: Rusty Russell @ 2016-04-12  7:30 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Andrew Morton

Jiri Kosina <jikos@kernel.org> writes:
> On Wed, 30 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.
>
> Not seeing this in your tree, let me send another friendly ping :)

Just pushed it into modules-next.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-12  7:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17  8:59 [PATCH] module: fix noreturn attribute for __module_put_and_exit() Jiri Kosina
2016-03-18  2:48 ` Rusty Russell
2016-03-21 10:13 ` [PATCH v2] " Jiri Kosina
2016-03-29 23:29   ` Jiri Kosina
2016-03-31 23:54     ` Rusty Russell
2016-04-01  6:31       ` Jiri Kosina
2016-04-06  5:22     ` Jiri Kosina
2016-04-12  7:30       ` Rusty Russell
2016-03-31 23:53   ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).