mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Drokin, Oleg" <oleg.drokin@intel.com>
To: Maxime Lorrillere <maxime.lorrillere@gmail.com>
Cc: "Dilger, Andreas" <andreas.dilger@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] staging: lustre: fix symbol redeclared with different type in libcfs
Date: Sat, 15 Aug 2015 10:13:53 +0000	[thread overview]
Message-ID: <138C4E5D-DD96-488D-97B0-CC44006DABBF@intel.com> (raw)
In-Reply-To: <1439627720-20748-1-git-send-email-maxime.lorrillere@gmail.com>


On Aug 15, 2015, at 4:35 AM, Maxime Lorrillere wrote:

> lbug_with_loc is declared with __attribute__((noreturn)) in libcfs_private.h
> and without this attribute in linux-debug.c. This generates the following
> sparse error:
>>>> drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:149:6: error: symbol 'lbug_with_loc' redeclared with different type (originally declared at drivers/staging/lustre/lustre/libcfs/linux/../../../include/linux/libcfs/libcfs_private.h:82) - different modifiers
> 
> This patches removes this attribute in libcfs_private.h as it seems to me that
> this optimization is not necessary.

Well, the whole idea is that the attribute tells the compiler and thing like static analysis tools
that there's no return from this function.
This helps us to highlight dead code and also certain false positive warnings
abut stuff possibly used not-initialized and the like.
I'd rather prefer the actual function to be declared as no-return.

Thanks.
> 
> Signed-off-by: Maxime Lorrillere <maxime.lorrillere@gmail.com>
> ---
> drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> index 9544860..e60b92b 100644
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> @@ -79,7 +79,7 @@ do {									\
> 
> #define KLASSERT(e) LASSERT(e)
> 
> -void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn));
> +void lbug_with_loc(struct libcfs_debug_msg_data *);
> 
> #define LBUG()							  \
> do {								    \
> -- 
> 2.5.0
> 


      reply	other threads:[~2015-08-15 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15  8:35 Maxime Lorrillere
2015-08-15 10:13 ` Drokin, Oleg [this message]

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=138C4E5D-DD96-488D-97B0-CC44006DABBF@intel.com \
    --to=oleg.drokin@intel.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.lorrillere@gmail.com \
    /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®