All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
To: Bilel DRIRA <bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error
Date: Mon, 15 Jun 2015 16:06:33 -0700	[thread overview]
Message-ID: <20150615230633.GA14978@kroah.com> (raw)
In-Reply-To: <1434320613-28700-1-git-send-email-bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Sun, Jun 14, 2015 at 11:23:32PM +0100, Bilel DRIRA wrote:
> define a silent macro when _CHECKER_ is defined.
> This change fixes the following sparse errors:
> 
> include/uapi/linux/swab.h:60:16: error: undefined identifier '__builtin_bswap32'
> include/uapi/linux/swab.h:60:33: error: not a function <noident>
> include/uapi/linux/swab.h:71:16: error: undefined identifier '__builtin_bswap64'
> include/uapi/linux/swab.h:71:33: error: not a function <noident>
> include/uapi/linux/swab.h:60:33: error: not a function <noident>
> 
> Signed-off-by: Bilel DRIRA <bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  include/uapi/linux/swab.h |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
> index 0e011eb..c04de49 100644
> --- a/include/uapi/linux/swab.h
> +++ b/include/uapi/linux/swab.h
> @@ -5,6 +5,18 @@
>  #include <linux/compiler.h>
>  #include <asm/swab.h>
>  
> +#ifdef __CHECKER__
> +
> +#ifdef __HAVE_BUILTIN_BSWAP64__
> +#define __builtin_bswap64(val) (0)
> +#endif
> +
> +#ifdef __HAVE_BUILTIN_BSWAP32__
> +#define __builtin_bswap32(val) (0)
> +#endif
> +
> +#endif	/* __CHECKER__ */

Shouldn't the tool be fixed instead of papering over the issue with
random defines like this?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Bilel DRIRA <bilel.dr@gmail.com>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error
Date: Mon, 15 Jun 2015 16:06:33 -0700	[thread overview]
Message-ID: <20150615230633.GA14978@kroah.com> (raw)
In-Reply-To: <1434320613-28700-1-git-send-email-bilel.dr@gmail.com>

On Sun, Jun 14, 2015 at 11:23:32PM +0100, Bilel DRIRA wrote:
> define a silent macro when _CHECKER_ is defined.
> This change fixes the following sparse errors:
> 
> include/uapi/linux/swab.h:60:16: error: undefined identifier '__builtin_bswap32'
> include/uapi/linux/swab.h:60:33: error: not a function <noident>
> include/uapi/linux/swab.h:71:16: error: undefined identifier '__builtin_bswap64'
> include/uapi/linux/swab.h:71:33: error: not a function <noident>
> include/uapi/linux/swab.h:60:33: error: not a function <noident>
> 
> Signed-off-by: Bilel DRIRA <bilel.dr@gmail.com>
> ---
>  include/uapi/linux/swab.h |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
> index 0e011eb..c04de49 100644
> --- a/include/uapi/linux/swab.h
> +++ b/include/uapi/linux/swab.h
> @@ -5,6 +5,18 @@
>  #include <linux/compiler.h>
>  #include <asm/swab.h>
>  
> +#ifdef __CHECKER__
> +
> +#ifdef __HAVE_BUILTIN_BSWAP64__
> +#define __builtin_bswap64(val) (0)
> +#endif
> +
> +#ifdef __HAVE_BUILTIN_BSWAP32__
> +#define __builtin_bswap32(val) (0)
> +#endif
> +
> +#endif	/* __CHECKER__ */

Shouldn't the tool be fixed instead of papering over the issue with
random defines like this?

thanks,

greg k-h

  parent reply	other threads:[~2015-06-15 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 22:23 [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error Bilel DRIRA
2015-06-14 22:23 ` Bilel DRIRA
     [not found] ` <1434320613-28700-1-git-send-email-bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-15 23:06   ` Greg KH [this message]
2015-06-15 23:06     ` Greg KH

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=20150615230633.GA14978@kroah.com \
    --to=greg-u8xffu+wg4eavxtiumwx3w@public.gmane.org \
    --cc=bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.