* [Qemu-devel] [PATCH] altera_timer: fix incorrect memset
@ 2017-05-18 10:33 Paolo Bonzini
2017-05-18 15:00 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2017-05-23 14:44 ` [Qemu-devel] " Michael Tokarev
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-05-18 10:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial
Use sizeof instead of ARRAY_SIZE, fixing -Wmemset-elt-size with recent
GCC versions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/timer/altera_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c
index 6d4862661d..c9a0fc5dca 100644
--- a/hw/timer/altera_timer.c
+++ b/hw/timer/altera_timer.c
@@ -204,7 +204,7 @@ static void altera_timer_reset(DeviceState *dev)
ptimer_stop(t->ptimer);
ptimer_set_limit(t->ptimer, 0xffffffff, 1);
- memset(t->regs, 0, ARRAY_SIZE(t->regs));
+ memset(t->regs, 0, sizeof(t->regs));
}
static Property altera_timer_properties[] = {
--
2.13.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] altera_timer: fix incorrect memset
2017-05-18 10:33 [Qemu-devel] [PATCH] altera_timer: fix incorrect memset Paolo Bonzini
@ 2017-05-18 15:00 ` Laurent Vivier
2017-05-23 14:44 ` [Qemu-devel] " Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-05-18 15:00 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial
On 18/05/2017 12:33, Paolo Bonzini wrote:
> Use sizeof instead of ARRAY_SIZE, fixing -Wmemset-elt-size with recent
> GCC versions.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/timer/altera_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c
> index 6d4862661d..c9a0fc5dca 100644
> --- a/hw/timer/altera_timer.c
> +++ b/hw/timer/altera_timer.c
> @@ -204,7 +204,7 @@ static void altera_timer_reset(DeviceState *dev)
>
> ptimer_stop(t->ptimer);
> ptimer_set_limit(t->ptimer, 0xffffffff, 1);
> - memset(t->regs, 0, ARRAY_SIZE(t->regs));
> + memset(t->regs, 0, sizeof(t->regs));
> }
>
> static Property altera_timer_properties[] = {
>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] altera_timer: fix incorrect memset
2017-05-18 10:33 [Qemu-devel] [PATCH] altera_timer: fix incorrect memset Paolo Bonzini
2017-05-18 15:00 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
@ 2017-05-23 14:44 ` Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2017-05-23 14:44 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial
Applied to -trivial, thanks!
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-23 14:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18 10:33 [Qemu-devel] [PATCH] altera_timer: fix incorrect memset Paolo Bonzini
2017-05-18 15:00 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2017-05-23 14:44 ` [Qemu-devel] " Michael Tokarev
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).