linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bilel DRIRA <bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Bilel DRIRA <bilel.dr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error
Date: Sun, 14 Jun 2015 23:23:32 +0100	[thread overview]
Message-ID: <1434320613-28700-1-git-send-email-bilel.dr@gmail.com> (raw)

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__ */
+
 /*
  * casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
-- 
1.7.9.5

             reply	other threads:[~2015-06-14 22:23 UTC|newest]

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