qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-trivial@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
Date: Wed, 05 Sep 2012 19:15:39 +0200	[thread overview]
Message-ID: <504788BB.7030609@weilnetz.de> (raw)
In-Reply-To: <CAJSP0QXtri4UNmdriCFiTg4_m+-a0CBpG36FYFdXQ1XcJywNww@mail.gmail.com>

Am 05.09.2012 18:55, schrieb Stefan Hajnoczi:
> On Wed, Sep 5, 2012 at 4:51 PM, Andreas Färber<afaerber@suse.de>  wrote:
>> Am 03.09.2012 22:23, schrieb Stefan Weil:
>>> Report from smatch:
>>> sparc-dis.c:2664 build_hash_table(14) info:
>>>   redundant null check on hash_buf calling free()
>>>
>>> Signed-off-by: Stefan Weil<sw@weilnetz.de>
>>> ---
>>>
>>> Coding style was not fixed.
>>>
>>> - sw
>>>
>>>   sparc-dis.c |    3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/sparc-dis.c b/sparc-dis.c
>>> index cdd337a..ef28835 100644
>>> --- a/sparc-dis.c
>>> +++ b/sparc-dis.c
>>> @@ -2660,8 +2660,7 @@ build_hash_table (const sparc_opcode **opcode_table,
>>>
>>>     memset (hash_table, 0, HASH_SIZE * sizeof (hash_table[0]));
>>>     memset (hash_count, 0, HASH_SIZE * sizeof (hash_count[0]));
>>> -  if (hash_buf != NULL)
>>> -    free (hash_buf);
>>> +  free (hash_buf);
>>>     hash_buf = malloc (sizeof (* hash_buf) * num_opcodes);
>>>     for (i = num_opcodes - 1; i>= 0; --i)
>>>       {
>>
>> *-dis sounds like binutils - did upstream drop the if, too?
>> If not, then diverging for a non-issue does not seem necessary.
>
> Ah, good point.  I don't think we should apply this patch :P.
>
> Dropping the patch from qemu-trivial until this discussion finishes.
>
> Stefan

AFAIK, binutils moved to GPL 3. Therefore I don't expect that
QEMU will update to upstream in the next years.

We'll have to maintain the code which we have.

Try "git log *-dis.c" or "gitk *-dis.c": there are already lots
of more trivial changes which got applied to the disassembler files.

=> The patch should be applied.

Regards,
Stefan

  reply	other threads:[~2012-09-05 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 20:23 [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check Stefan Weil
2012-09-05  9:34 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
2012-09-05 16:55   ` Stefan Hajnoczi
2012-09-05 17:15     ` Stefan Weil [this message]
2012-09-05 17:45       ` Stefan Weil
2012-09-20 17:03         ` Stefan Weil
2012-09-21  8:06           ` Andreas Färber
2012-09-05 18:13   ` Stefan Weil

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=504788BB.7030609@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=afaerber@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 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).