[PATCH] rename __bitwise definition in endian.h

Alex Chiang achiang at hp.com
Tue Apr 1 12:03:17 PDT 2008


Running sparse in userspace on a Debian/4.0 userspace results in
a redefinition warning:

gcc -g -Wall -Werror -D_FILE_OFFSET_BITS=64 -Iinclude -MD -MP -MF crfsd/bdev.d -c crfsd/bdev.c -o crfsd/bdev.o
sparse -m64 -include .sparse.gcc-defines.h -I/usr/lib/gcc/ia64-linux-gnu/4.1.2/ -Wbitwise -D__CHECKER__ -g -Wall -Werror -D_FILE_OFFSET_BITS=64 -Iinclude crfsd/bdev.c
/usr/include/linux/types.h:178:9: warning: preprocessor token __bitwise redefined
include/crfs-shared/endian.h:33:10: this was the original definition

Change the crfs definition of __bitwise to something less
collision-prone.

Signed-off-by: Alex Chiang <achiang at hp.com>

diff -r 51977a8efba4 include/crfs-shared/endian.h
--- a/include/crfs-shared/endian.h	Mon Mar 31 21:06:46 2008 -0600
+++ b/include/crfs-shared/endian.h	Tue Apr 01 12:56:04 2008 -0600
@@ -29,19 +29,19 @@
  */
 
 #ifdef __CHECKER__
-# define __force        __attribute__((force))
-# define __bitwise	__attribute__((bitwise))
+# define __crfs_force		__attribute__((force))
+# define __crfs_bitwise		__attribute__((bitwise))
 #else
-# define __force        
-# define __bitwise
+# define __crfs_force        
+# define __crfs_bitwise
 #endif
 
-typedef uint16_t __bitwise le16;
-typedef uint16_t __bitwise be16;
-typedef uint32_t __bitwise le32;
-typedef uint32_t __bitwise be32;
-typedef uint64_t __bitwise le64;
-typedef uint64_t __bitwise be64;
+typedef uint16_t __crfs_bitwise le16;
+typedef uint16_t __crfs_bitwise be16;
+typedef uint32_t __crfs_bitwise le32;
+typedef uint32_t __crfs_bitwise be32;
+typedef uint64_t __crfs_bitwise le64;
+typedef uint64_t __crfs_bitwise be64;
 
 static inline uint16_t __swab16(uint16_t x)
 {
@@ -72,21 +72,21 @@ static inline uint64_t __swab64(uint64_t
 #define __gen_cast_tofrom(end, size)					\
 static inline end##size to_##end##size(uint##size##_t x)	\
 {									\
-	return (__force end##size)x;				\
+	return (__crfs_force end##size)x;				\
 }									\
 static inline uint##size##_t from_##end##size(end##size x)	\
 {									\
-	return (__force uint##size##_t)x;				\
+	return (__crfs_force uint##size##_t)x;				\
 }
 
 #define __gen_swap_tofrom(end, size)					\
 static inline end##size to_##end##size(uint##size##_t x)	\
 {									\
-	return (__force end##size)__swab##size(x);		\
+	return (__crfs_force end##size)__swab##size(x);		\
 }									\
 static inline uint##size##_t from_##end##size(end##size x)	\
 {									\
-	return __swab##size((__force uint##size##_t) x);		\
+	return __swab##size((__crfs_force uint##size##_t) x);		\
 }
 
 #define __gen_functions(which, end)	\



More information about the crfs-devel mailing list