bitops: fix test_and_change_bit()
./bitops.h:192: warning: ‘old’ is used uninitialized in this function Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
89d2d3af51
commit
04483e150d
2
bitops.h
2
bitops.h
@ -187,7 +187,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
|
|||||||
{
|
{
|
||||||
unsigned long mask = BIT_MASK(nr);
|
unsigned long mask = BIT_MASK(nr);
|
||||||
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
|
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
|
||||||
unsigned long old;
|
unsigned long old = *p;
|
||||||
|
|
||||||
*p = old ^ mask;
|
*p = old ^ mask;
|
||||||
return (old & mask) != 0;
|
return (old & mask) != 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user