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