qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-mips: fix call to memset in soft reset code
@ 2016-05-09 16:44 Aurelien Jarno
  2016-05-09 17:53 ` Stefan Weil
  2016-05-12 11:45 ` Leon Alrae
  0 siblings, 2 replies; 11+ messages in thread
From: Aurelien Jarno @ 2016-05-09 16:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurelien Jarno, Stefan Weil, Leon Alrae

Recent versions of GCC report the following error when compiling
target-mips/helper.c:

  qemu/target-mips/helper.c:542:9: warning: ‘memset’ used with length
  equal to number of elements without multiplication by element size
  [-Wmemset-elt-size]

This is indeed correct and due to a wrong usage of sizeof(). Fix that.

Cc: Stefan Weil <sw@weilnetz.de>
Cc: Leon Alrae <leon.alrae@imgtec.com>
LP: https://bugs.launchpad.net/qemu/+bug/1577841
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-mips/helper.c b/target-mips/helper.c
index 1004ede..cfea177 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -539,7 +539,7 @@ void mips_cpu_do_interrupt(CPUState *cs)
         break;
     case EXCP_SRESET:
         env->CP0_Status |= (1 << CP0St_SR);
-        memset(env->CP0_WatchLo, 0, sizeof(*env->CP0_WatchLo));
+        memset(env->CP0_WatchLo, 0, sizeof(env->CP0_WatchLo));
         goto set_error_EPC;
     case EXCP_NMI:
         env->CP0_Status |= (1 << CP0St_NMI);
-- 
2.8.1

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

end of thread, other threads:[~2016-05-12 11:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-09 16:44 [Qemu-devel] [PATCH] target-mips: fix call to memset in soft reset code Aurelien Jarno
2016-05-09 17:53 ` Stefan Weil
2016-05-09 17:55   ` Peter Maydell
2016-05-09 17:57     ` Peter Maydell
2016-05-11 19:28       ` Christian Borntraeger
2016-05-11 22:41         ` Peter Maydell
2016-05-12  7:40           ` Christian Borntraeger
2016-05-12  8:04             ` Peter Maydell
2016-05-12  8:06             ` Cornelia Huck
2016-05-12  8:16               ` Christian Borntraeger
2016-05-12 11:45 ` Leon Alrae

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).