From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: Fix warning in emulator_cmpxchg_emulated Date: Thu, 08 Dec 2011 09:04:08 +0100 Message-ID: <4EE06F78.6030305@web.de> References: <1323325040-10548-1-git-send-email-levinsasha928@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5B66B4716806CF1037424225" Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com To: Sasha Levin Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:49488 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941Ab1LHIEU (ORCPT ); Thu, 8 Dec 2011 03:04:20 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate01.web.de (Postfix) with ESMTP id A00A61A433CBA for ; Thu, 8 Dec 2011 09:04:18 +0100 (CET) In-Reply-To: <1323325040-10548-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5B66B4716806CF1037424225 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-12-08 07:17, Sasha Levin wrote: > Make sure 'exchanged' is initialized. Fixes the following warning: >=20 > arch/x86/kvm/x86.c: In function 'emulator_cmpxchg_emulated': > arch/x86/kvm/x86.c:3794:7: warning: 'exchanged' may be used uninitializ= ed in this function >=20 > Signed-off-by: Sasha Levin > --- > arch/x86/kvm/x86.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) >=20 > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index eeeaf2e..9338afc 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3791,7 +3791,7 @@ static int emulator_cmpxchg_emulated(struct x86_e= mulate_ctxt *ctxt, > gpa_t gpa; > struct page *page; > char *kaddr; > - bool exchanged; > + bool exchanged =3D false; > =20 > /* guests cmpxchg8b have to be emulated atomically */ > if (bytes > 8 || (bytes & (bytes - 1))) Isn't BUG() tagged as no-return in the kernel? Because this initialization is obviously unneeded. Jan --------------enig5B66B4716806CF1037424225 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7gb3gACgkQitSsb3rl5xSrBgCgwzsuIFiNF+qtx6N41t8+8q/J wO8An1ym9noH93yEojsrWWf7Ur3SCCMr =21Tu -----END PGP SIGNATURE----- --------------enig5B66B4716806CF1037424225--