mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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
1 changed files with 1 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue