]> Git Repo - qemu.git/commitdiff
target-mips: fix call to memset in soft reset code
authorAurelien Jarno <[email protected]>
Mon, 9 May 2016 16:44:00 +0000 (18:44 +0200)
committerLeon Alrae <[email protected]>
Thu, 12 May 2016 10:01:05 +0000 (11:01 +0100)
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 <[email protected]>
Cc: Leon Alrae <[email protected]>
Cc: [email protected]
LP: https://bugs.launchpad.net/qemu/+bug/1577841
Signed-off-by: Aurelien Jarno <[email protected]>
Reviewed-by: Stefan Weil <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
target-mips/helper.c

index 1004edee05b432b1c976f24d57633a464c77b948..cfea177ee55eb295e67de5d12e03df25195b5369 100644 (file)
@@ -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);
This page took 0.027259 seconds and 4 git commands to generate.