Skip to contentSkip to conversation

test_bitmap: Use ULL suffix for 64-bit constants

PATCH Applied Geert Uytterhoeven 2 participants 2 messages Sep 10, 2017

Subsystems (2)

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test_bitmap: Use ULL suffix for 64-bit constants

With gcc 4.1.2:

lib/test_bitmap.c:189: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:190: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:194: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:195: warning: integer constant is too large for ‘long’ type

Add the missing "ULL" suffix to fix this.

Fixes 60ef690018b262dd ("bitmap: introduce BITMAP_FROM_U64()")
---
 lib/test_bitmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/test_bitmap.c +4 -4
index 599c6713f2a2aaa8..aa1f2669bdd5d836 100644
@@ -186,13 +186,13 @@ static const unsigned long exp[] __initconst = {
 	BITMAP_FROM_U64(0x22222222),
 	BITMAP_FROM_U64(0xffffffff),
 	BITMAP_FROM_U64(0xfffffffe),
-	BITMAP_FROM_U64(0x3333333311111111),
-	BITMAP_FROM_U64(0xffffffff77777777)
+	BITMAP_FROM_U64(0x3333333311111111ULL),
+	BITMAP_FROM_U64(0xffffffff77777777ULL)
 };
 
 static const unsigned long exp2[] __initconst = {
-	BITMAP_FROM_U64(0x3333333311111111),
-	BITMAP_FROM_U64(0xffffffff77777777)
+	BITMAP_FROM_U64(0x3333333311111111ULL),
+	BITMAP_FROM_U64(0xffffffff77777777ULL)
 };
 
 static const struct test_bitmap_parselist parselist_tests[] __initconst = {
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

With gcc 4.1.2:

lib/test_bitmap.c:189: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:190: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:194: warning: integer constant is too large for ‘long’ type lib/test_bitmap.c:195: warning: integer constant is too large for ‘long’ type

Add the missing "ULL" suffix to fix this.

Fixes 60ef690018b262dd ("bitmap: introduce BITMAP_FROM_U64()")

Thanks.

Quoted 28 lines
---
 lib/test_bitmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/test_bitmap.c +4 -4
index 599c6713f2a2aaa8..aa1f2669bdd5d836 100644
@@ -186,13 +186,13 @@ static const unsigned long exp[] __initconst = {
 	BITMAP_FROM_U64(0x22222222),
 	BITMAP_FROM_U64(0xffffffff),
 	BITMAP_FROM_U64(0xfffffffe),
-	BITMAP_FROM_U64(0x3333333311111111),
-	BITMAP_FROM_U64(0xffffffff77777777)
+	BITMAP_FROM_U64(0x3333333311111111ULL),
+	BITMAP_FROM_U64(0xffffffff77777777ULL)
 };
 
 static const unsigned long exp2[] __initconst = {
-	BITMAP_FROM_U64(0x3333333311111111),
-	BITMAP_FROM_U64(0xffffffff77777777)
+	BITMAP_FROM_U64(0x3333333311111111ULL),
+	BITMAP_FROM_U64(0xffffffff77777777ULL)
 };
 
 static const struct test_bitmap_parselist parselist_tests[] __initconst = {
Signature · 1 line
2.7.4