mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH 1/1] KERNEL: add __attribute__  in c file
Date: Wed, 7 May 2014 15:25:57 -0700	[thread overview]
Message-ID: <20140507152557.7bf8998f900c5f2054295e68@linux-foundation.org> (raw)
In-Reply-To: <20140507223339.3dccf63d066edbcac207e6f3@skynet.be>

On Wed, 7 May 2014 22:33:39 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> This patch fixes a sparse warning about noreturn attribute only
> featuring in module.h
> 
> kernel/module.c:212:6: error: symbol '__module_put_and_exit' redeclared with
> different type (originally declared at include/linux/module.h:449)-
> different modifiers
> 
> ...
>
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -446,8 +446,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 079c461..7d78872 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -209,7 +209,8 @@ 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)
>  {

Can we use __noreturn here?

  reply	other threads:[~2014-05-07 22:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 20:33 Fabian Frederick
2014-05-07 22:25 ` Andrew Morton [this message]
2014-05-10 10:16   ` Fabian Frederick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140507152557.7bf8998f900c5f2054295e68@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®