summaryrefslogtreecommitdiff
path: root/bitops.h
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2011-02-24 23:47:08 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-02-25 17:19:02 +0000
commit04483e150d412f5861a00c30581df7ba90a816e7 (patch)
treeed7433377a3bdadab6f7f3511c6035491f49b7b8 /bitops.h
parent89d2d3af518879ddfca367e56627229a09e90352 (diff)
downloadqemu-04483e150d412f5861a00c30581df7ba90a816e7.tar.gz
qemu-04483e150d412f5861a00c30581df7ba90a816e7.tar.bz2
qemu-04483e150d412f5861a00c30581df7ba90a816e7.zip
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>
Diffstat (limited to 'bitops.h')
-rw-r--r--bitops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitops.h b/bitops.h
index ae7bcb1b1c..e2b9df3155 100644
--- a/bitops.h
+++ b/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 *p = ((unsigned long *)addr) + BIT_WORD(nr);
- unsigned long old;
+ unsigned long old = *p;
*p = old ^ mask;
return (old & mask) != 0;