lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130730150259.71b22fd0@nehalam.linuxnetplumber.net>
Date:	Tue, 30 Jul 2013 15:02:59 -0700
From:	Stephen Hemminger <stephen@...workplumber.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>,
	David Howells <dhowells@...hat.com>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] swab: fix sparse warnings

There are a lot of sparse warnings in networking code where a constant
ends up being byte swapped caused because there is no explicit
prototype for the __builtin_bswap functions.  Simplest workaround
is to just avoid them here, and use the normal swap routines when
doing sparse checks.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>

--- a/include/uapi/linux/swab.h	2013-05-11 15:58:53.844321915 -0700
+++ b/include/uapi/linux/swab.h	2013-07-30 14:49:22.066773449 -0700
@@ -45,7 +45,7 @@
 
 static inline __attribute_const__ __u16 __fswab16(__u16 val)
 {
-#ifdef __HAVE_BUILTIN_BSWAP16__
+#if defined(__HAVE_BUILTIN_BSWAP16__) && !defined(__CHECKER__)
 	return __builtin_bswap16(val);
 #elif defined (__arch_swab16)
 	return __arch_swab16(val);
@@ -56,7 +56,7 @@ static inline __attribute_const__ __u16
 
 static inline __attribute_const__ __u32 __fswab32(__u32 val)
 {
-#ifdef __HAVE_BUILTIN_BSWAP32__
+#if defined(__HAVE_BUILTIN_BSWAP32__) && !defined(__CHECKER__)
 	return __builtin_bswap32(val);
 #elif defined(__arch_swab32)
 	return __arch_swab32(val);
@@ -67,7 +67,7 @@ static inline __attribute_const__ __u32
 
 static inline __attribute_const__ __u64 __fswab64(__u64 val)
 {
-#ifdef __HAVE_BUILTIN_BSWAP64__
+#if defined(__HAVE_BUILTIN_BSWAP64__) && !defined(__CHECKER__)
 	return __builtin_bswap64(val);
 #elif defined (__arch_swab64)
 	return __arch_swab64(val);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ