From ec5edac74c1a45812068d04a2c37f0be61742eed Mon Sep 17 00:00:00 2001
Message-Id: <ec5edac74c1a45812068d04a2c37f0be61742eed.1350312451.git.minovotn@redhat.com>
In-Reply-To: <aa2da19f266f7dd7345db5620ee362446fc6e806.1350312451.git.minovotn@redhat.com>
References: <aa2da19f266f7dd7345db5620ee362446fc6e806.1350312451.git.minovotn@redhat.com>
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 18 Sep 2012 15:25:05 +0200
Subject: [PATCH 02/27] bitops: fix test_and_change_bit()

RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1347981910-9069-3-git-send-email-pbonzini@redhat.com>
Patchwork-id: 41993
O-Subject: [RHEL 6.4/6.3.z qemu-kvm PATCH v3 2/7] bitops: fix test_and_change_bit()
Bugzilla: 844627
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

From: Corentin Chary <corentincj@iksaif.net>

Bugzilla: 844627

./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>
(cherry-picked from upstream commit 04483e150d412f5861a00c30581df7ba90a816e7)
---
 bitops.h | 2 +-
 1 file modificato, 1 inserzione(+). 1 rimozione(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 bitops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.11.7

