lkml.org 
[lkml]   [2012]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] include: Fix compile warning in include/linux/bitops.h
Date
The compile warning is caused by __const_hweight8 when using
hweight_long with -Wsign-compare option.
The reason is that the default return value of this macro is signed.
So need type casting to remove warning.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
include/asm-generic/bitops/const_hweight.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/bitops/const_hweight.h b/include/asm-generic/bitops/const_hweight.h
index fa2a50b..3ad0dae 100644
--- a/include/asm-generic/bitops/const_hweight.h
+++ b/include/asm-generic/bitops/const_hweight.h
@@ -4,7 +4,7 @@
/*
* Compile time versions of __arch_hweightN()
*/
-#define __const_hweight8(w) \
+#define __const_hweight8(w) (unsigned long) \
( (!!((w) & (1ULL << 0))) + \
(!!((w) & (1ULL << 1))) + \
(!!((w) & (1ULL << 2))) + \
--
1.7.9.5


\
 
 \ /
  Last update: 2012-06-09 06:01    [W:0.091 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site