mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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>
This commit is contained in:
parent
8a5321d99c
commit
d324645db5
1 changed files with 4 additions and 4 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue