Re: [PATCH] KVM: x86: silence GCC warning on memset ioapic->irq_eoi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxx>
> Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux