From: Corentin Chary Date: Thu, 24 Feb 2011 22:47:08 +0000 (+0100) Subject: bitops: fix test_and_change_bit() X-Git-Tag: TizenStudio_2.0_p2.3~3279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dee76ea91028a5a6f33a50a15b91cf99abcd0fe9;p=sdk%2Femulator%2Fqemu.git bitops: fix test_and_change_bit() ./bitops.h:192: warning: ‘old’ is used uninitialized in this function Signed-off-by: Corentin Chary Signed-off-by: Blue Swirl --- 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;