* [PATCH] kvm: memset whole irq_eoi
@ 2016-10-13 15:45 Jiri Slaby
2016-10-13 15:47 ` Paolo Bonzini
2016-10-13 16:21 ` Radim Krčmář
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2016-10-13 15:45 UTC (permalink / raw)
To: pbonzini
Cc: linux-kernel, Jiri Slaby, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, kvm
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 <jslaby@suse.cz>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
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);
}
--
2.10.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kvm: memset whole irq_eoi
2016-10-13 15:45 [PATCH] kvm: memset whole irq_eoi Jiri Slaby
@ 2016-10-13 15:47 ` Paolo Bonzini
2016-10-13 16:21 ` Radim Krčmář
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-10-13 15:47 UTC (permalink / raw)
To: Jiri Slaby
Cc: linux-kernel, Radim Krčmář, Thomas Gleixner,
Ingo Molnar, H . Peter Anvin, x86, kvm, stable
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 <jslaby@suse.cz>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> 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 <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kvm: memset whole irq_eoi
2016-10-13 15:45 [PATCH] kvm: memset whole irq_eoi Jiri Slaby
2016-10-13 15:47 ` Paolo Bonzini
@ 2016-10-13 16:21 ` Radim Krčmář
1 sibling, 0 replies; 3+ messages in thread
From: Radim Krčmář @ 2016-10-13 16:21 UTC (permalink / raw)
To: Jiri Slaby
Cc: pbonzini, linux-kernel, Thomas Gleixner, Ingo Molnar,
H . Peter Anvin, x86, kvm
2016-10-13 17:45+0200, Jiri Slaby:
> 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 <jslaby@suse.cz>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: kvm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
Added x86 subject tag and applied to kvm/queue, thanks.
> 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);
> }
>
> --
> 2.10.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-13 16:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 15:45 [PATCH] kvm: memset whole irq_eoi Jiri Slaby
2016-10-13 15:47 ` Paolo Bonzini
2016-10-13 16:21 ` Radim Krčmář
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).