Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724AbcJMPr3 (ORCPT ); Thu, 13 Oct 2016 11:47:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932540AbcJMPrO (ORCPT ); Thu, 13 Oct 2016 11:47:14 -0400 Subject: Re: [PATCH] kvm: memset whole irq_eoi To: Jiri Slaby References: <20161013154520.29747-1-jslaby@suse.cz> Cc: linux-kernel@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, stable From: Paolo Bonzini Message-ID: Date: Thu, 13 Oct 2016 17:47:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161013154520.29747-1-jslaby@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 13 Oct 2016 15:47:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 37 On 13/10/2016 17:45, Jiri Slaby wrote: > gcc 7 warns: > arch/x86/kvm/ioapic.c: In function 'kvm_ioapic_reset': > arch/x86/kvm/ioapic.c:597:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] > > And it is right. Memset whole array using sizeof operator. > > Signed-off-by: Jiri Slaby > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: x86@kernel.org > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > 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 c7220ba94aa7..1a22de70f7f7 100644 > --- a/arch/x86/kvm/ioapic.c > +++ b/arch/x86/kvm/ioapic.c > @@ -594,7 +594,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); > } > > Cc: stable@vger.kernel.org Reviewed-by: Paolo Bonzini