All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>, kvm@vger.kernel.org
Cc: David Binderman <dcb314@hotmail.com>
Subject: Re: [PATCH] KVM: x86: silence GCC warning on memset ioapic->irq_eoi
Date: Mon, 9 May 2016 15:02:55 +0200	[thread overview]
Message-ID: <57308A7F.9020309@redhat.com> (raw)
In-Reply-To: <1462210453-27907-1-git-send-email-rkrcmar@redhat.com>



On 02/05/2016 19:34, Radim Krčmář wrote:
> New GCC notices a mistake,
>   arch/x86/kvm/ioapic.c:595:2: warning: ‘memset’ used with length equal
>   to number of elements without multiplication by element size
>   [-Wmemset-elt-size]
> 
> that has no effect on execution, because we zero a zeroed array.
> Preserve the useless memset as kvm_ioapic_reset() wants to be generic.
> 
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  arch/x86/kvm/ioapic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
> index 9db47090ead0..4861e6e622a3 100644
> --- a/arch/x86/kvm/ioapic.c
> +++ b/arch/x86/kvm/ioapic.c
> @@ -592,7 +592,7 @@ static void kvm_ioapic_reset(struct kvm_ioapic *ioapic)
>  	ioapic->irr = 0;
>  	ioapic->irr_delivered = 0;
>  	ioapic->id = 0;
> -	memset(ioapic->irq_eoi, 0x00, IOAPIC_NUM_PINS);
> +	memset(ioapic->irq_eoi, 0x00, sizeof(ioapic->irq_eoi));
>  	rtc_irq_eoi_tracking_reset(ioapic);
>  }
>  
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

      reply	other threads:[~2016-05-09 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 17:34 [PATCH] KVM: x86: silence GCC warning on memset ioapic->irq_eoi Radim Krčmář
2016-05-09 13:02 ` Paolo Bonzini [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=57308A7F.9020309@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dcb314@hotmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.