target-mips: fix call to memset in soft reset code

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>
Cc: qemu-stable@nongnu.org
LP: https://bugs.launchpad.net/qemu/+bug/1577841
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
This commit is contained in:
Aurelien Jarno 2016-05-09 18:44:00 +02:00 committed by Leon Alrae
parent bfc766d38e
commit 9d989c732b

View File

@ -539,7 +539,7 @@ void mips_cpu_do_interrupt(CPUState *cs)
break; break;
case EXCP_SRESET: case EXCP_SRESET:
env->CP0_Status |= (1 << CP0St_SR); 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; goto set_error_EPC;
case EXCP_NMI: case EXCP_NMI:
env->CP0_Status |= (1 << CP0St_NMI); env->CP0_Status |= (1 << CP0St_NMI);