Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1164931 > unrolled thread

[PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error

Started byBilel DRIRA <bilel.dr@gmail.com>
First post2015-06-15 00:30 +0200
Last post2015-06-15 00:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error Bilel DRIRA <bilel.dr@gmail.com> - 2015-06-15 00:30 +0200

#1164931 — [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error

FromBilel DRIRA <bilel.dr@gmail.com>
Date2015-06-15 00:30 +0200
Subject[PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error
Message-ID<pBozE-1dO-13@gated-at.bofh.it>
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__ */
+
 /*
  * 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web