All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Aurelien Jarno <aurelien@aurel32.net>, qemu-devel@nongnu.org
Cc: Leon Alrae <leon.alrae@imgtec.com>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] target-mips: fix call to memset in soft reset code
Date: Mon, 9 May 2016 19:53:15 +0200	[thread overview]
Message-ID: <5730CE8B.1000203@weilnetz.de> (raw)
In-Reply-To: <1462812240-31204-1-git-send-email-aurelien@aurel32.net>

Am 09.05.2016 um 18:44 schrieb Aurelien Jarno:
> 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);
> 

Reviewed-by: Stefan Weil <sw@weilnetz.de>

I suggest to apply this patch to 2.6, if this is still possible:

* It is a very small modification which fixes a bug.
* It fixes a new build error with recent gcc versions.

The first reason alone would not justify it for 2.6 as this
is a rather old bug.

Stefan

  reply	other threads:[~2016-05-09 17:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5730CE8B.1000203@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.