d2b3e5
From 80a4d3cf8cf227c1d0aa45153a6324b16ae5a647 Mon Sep 17 00:00:00 2001
d2b3e5
From: Andrei Vagin <avagin@virtuozzo.com>
d2b3e5
Date: Sun, 17 Jun 2018 06:44:42 +0300
d2b3e5
Subject: [PATCH] bitops: use the UL literal for constants
d2b3e5
d2b3e5
We operate by long variables in out bit arithmetics, so our constants
d2b3e5
should be marked as long too.
d2b3e5
d2b3e5
Cc: Adrian Reber <areber@redhat.com>
d2b3e5
Reported-by: Adrian Reber <areber@redhat.com>
d2b3e5
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
d2b3e5
Tested-by: Adrian Reber <areber@redhat.com>
d2b3e5
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
d2b3e5
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
d2b3e5
---
d2b3e5
 include/common/asm-generic/bitops.h | 8 ++++----
d2b3e5
 1 file changed, 4 insertions(+), 4 deletions(-)
d2b3e5
d2b3e5
diff --git a/include/common/asm-generic/bitops.h b/include/common/asm-generic/bitops.h
d2b3e5
index cb449fbf8d..fbd25c1b6b 100644
d2b3e5
--- a/include/common/asm-generic/bitops.h
d2b3e5
+++ b/include/common/asm-generic/bitops.h
d2b3e5
@@ -28,25 +28,25 @@
d2b3e5
 
d2b3e5
 static inline void set_bit(int nr, volatile unsigned long *addr) {
d2b3e5
 	addr += nr / BITS_PER_LONG;
d2b3e5
-	*addr |= (1 << (nr % BITS_PER_LONG));
d2b3e5
+	*addr |= (1UL << (nr % BITS_PER_LONG));
d2b3e5
 }
d2b3e5
 
d2b3e5
 static inline void change_bit(int nr, volatile unsigned long *addr)
d2b3e5
 {
d2b3e5
 	addr += nr / BITS_PER_LONG;
d2b3e5
-	*addr ^= (1 << (nr % BITS_PER_LONG));
d2b3e5
+	*addr ^= (1UL << (nr % BITS_PER_LONG));
d2b3e5
 }
d2b3e5
 
d2b3e5
 static inline int test_bit(int nr, volatile const unsigned long *addr)
d2b3e5
 {
d2b3e5
 	addr += nr / BITS_PER_LONG;
d2b3e5
-	return (*addr & (1 << (nr % BITS_PER_LONG))) ? -1 : 0;
d2b3e5
+	return (*addr & (1UL << (nr % BITS_PER_LONG))) ? -1 : 0;
d2b3e5
 }
d2b3e5
 
d2b3e5
 static inline void clear_bit(int nr, volatile unsigned long *addr)
d2b3e5
 {
d2b3e5
 	addr += nr / BITS_PER_LONG;
d2b3e5
-	*addr &= ~(1 << (nr % BITS_PER_LONG));
d2b3e5
+	*addr &= ~(1UL << (nr % BITS_PER_LONG));
d2b3e5
 }
d2b3e5
 
d2b3e5
 /**