public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com
Subject: Re: [PATCH] KVM: Fix warning in emulator_cmpxchg_emulated
Date: Thu, 08 Dec 2011 10:25:24 +0200	[thread overview]
Message-ID: <1323332724.3904.7.camel@lappy> (raw)
In-Reply-To: <4EE06F78.6030305@web.de>

On Thu, 2011-12-08 at 09:04 +0100, Jan Kiszka wrote:
> On 2011-12-08 07:17, Sasha Levin wrote:
> > Make sure 'exchanged' is initialized. Fixes the following warning:
> > 
> > arch/x86/kvm/x86.c: In function 'emulator_cmpxchg_emulated':
> > arch/x86/kvm/x86.c:3794:7: warning: 'exchanged' may be used uninitialized in this function
> > 
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > ---
> >  arch/x86/kvm/x86.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > 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_emulate_ctxt *ctxt,
> >  	gpa_t gpa;
> >  	struct page *page;
> >  	char *kaddr;
> > -	bool exchanged;
> > +	bool exchanged = false;
> >  
> >  	/* 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.

It looks like __builtin_unreachable() requires a gcc newer than mine.

-- 

Sasha.


      reply	other threads:[~2011-12-08  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08  6:17 [PATCH] KVM: Fix warning in emulator_cmpxchg_emulated Sasha Levin
2011-12-08  8:04 ` Jan Kiszka
2011-12-08  8:25   ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323332724.3904.7.camel@lappy \
    --to=levinsasha928@gmail.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox