Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@virtuozzo.com>2018-06-17 06:44:42 +0300
committerPavel Emelyanov <xemul@virtuozzo.com>2018-07-09 18:26:49 +0300
commitd324645db58f2e5ccfb3edf61e0601bcf22f7964 (patch)
tree4b618ec8362a93cbcec4508218bc9b0c3fc4066d /include
parent8a5321d99c7ef5f65bd1357f9c650f2988315bcc (diff)
bitops: use the UL literal for constants
We operate by long variables in out bit arithmetics, so our constants should be marked as long too. Cc: Adrian Reber <areber@redhat.com> Reported-by: Adrian Reber <areber@redhat.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Tested-by: Adrian Reber <areber@redhat.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'include')
-rw-r--r--include/common/asm-generic/bitops.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/common/asm-generic/bitops.h b/include/common/asm-generic/bitops.h
index cb449fbf8..fbd25c1b6 100644
--- a/include/common/asm-generic/bitops.h
+++ b/include/common/asm-generic/bitops.h
@@ -28,25 +28,25 @@
static inline void set_bit(int nr, volatile unsigned long *addr) {
addr += nr / BITS_PER_LONG;
- *addr |= (1 << (nr % BITS_PER_LONG));
+ *addr |= (1UL << (nr % BITS_PER_LONG));
}
static inline void change_bit(int nr, volatile unsigned long *addr)
{
addr += nr / BITS_PER_LONG;
- *addr ^= (1 << (nr % BITS_PER_LONG));
+ *addr ^= (1UL << (nr % BITS_PER_LONG));
}
static inline int test_bit(int nr, volatile const unsigned long *addr)
{
addr += nr / BITS_PER_LONG;
- return (*addr & (1 << (nr % BITS_PER_LONG))) ? -1 : 0;
+ return (*addr & (1UL << (nr % BITS_PER_LONG))) ? -1 : 0;
}
static inline void clear_bit(int nr, volatile unsigned long *addr)
{
addr += nr / BITS_PER_LONG;
- *addr &= ~(1 << (nr % BITS_PER_LONG));
+ *addr &= ~(1UL << (nr % BITS_PER_LONG));
}
/**