All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: silence GCC warning on memset ioapic->irq_eoi
@ 2016-05-02 17:34 Radim Krčmář
  2016-05-09 13:02 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Radim Krčmář @ 2016-05-02 17:34 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, David Binderman

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);
 }
 
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: silence GCC warning on memset ioapic->irq_eoi
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-05-09 13:02 UTC (permalink / raw)
  To: Radim Krčmář, kvm; +Cc: David Binderman



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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-09 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.