[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] bitops: fix test_and_change_bit()
From: |
Corentin Chary |
Subject: |
[Qemu-devel] [PATCH] bitops: fix test_and_change_bit() |
Date: |
Thu, 24 Feb 2011 23:47:08 +0100 |
./bitops.h:192: warning: ‘old’ is used uninitialized in this function
Signed-off-by: Corentin Chary <address@hidden>
---
bitops.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/bitops.h b/bitops.h
index ae7bcb1..e2b9df3 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;
--
1.7.4.1
- [Qemu-devel] [PATCH] bitops: fix test_and_change_bit(),
Corentin Chary <=