All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
@ 2012-09-03 20:23 Stefan Weil
  2012-09-05  9:34 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Weil @ 2012-09-03 20:23 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Stefan Weil, qemu-devel

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)
     {
-- 
1.7.10

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-03 20:23 [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check Stefan Weil
@ 2012-09-05  9:34 ` Stefan Hajnoczi
  2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2012-09-05  9:34 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

On Mon, Sep 03, 2012 at 10:23:23PM +0200, Stefan Weil wrote:
> 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(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  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 ` Andreas Färber
  2012-09-05 16:55   ` Stefan Hajnoczi
  2012-09-05 18:13   ` Stefan Weil
  1 sibling, 2 replies; 9+ messages in thread
From: Andreas Färber @ 2012-09-05 15:51 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, Stefan Hajnoczi, qemu-devel

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.

Having said that, it's amazing what fixes you come up with. Did you
describe the use of that tool in some posting or in the Wiki?

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
@ 2012-09-05 16:55   ` Stefan Hajnoczi
  2012-09-05 17:15     ` Stefan Weil
  2012-09-05 18:13   ` Stefan Weil
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Hajnoczi @ 2012-09-05 16:55 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-trivial, Stefan Weil, qemu-devel

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

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-05 16:55   ` Stefan Hajnoczi
@ 2012-09-05 17:15     ` Stefan Weil
  2012-09-05 17:45       ` Stefan Weil
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Weil @ 2012-09-05 17:15 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Andreas Färber, qemu-devel

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

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-05 17:15     ` Stefan Weil
@ 2012-09-05 17:45       ` Stefan Weil
  2012-09-20 17:03         ` Stefan Weil
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Weil @ 2012-09-05 17:45 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Andreas Färber, qemu-devel

Am 05.09.2012 19:15, schrieb Stefan Weil:
>
> 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

Here is some additional information:

binutils switched from GPL 2 to GPL 3 with version 2.18:

Changes in 2.18:

* The binutils sources are now released under version 3 of the GNU General
   Public License.


sparc-dis.c is already based on 2.17, so we won't get anything newer.
Even the latest version still uses the redundant NULL check, so I
can send my patch to the binutils maintainers, too.

Regards,
Stefan

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
  2012-09-05 16:55   ` Stefan Hajnoczi
@ 2012-09-05 18:13   ` Stefan Weil
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Weil @ 2012-09-05 18:13 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Stefan Hajnoczi, qemu-devel

Am 05.09.2012 17:51, schrieb Andreas Färber:
> 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.
>
> Having said that, it's amazing what fixes you come up with. Did you
> describe the use of that tool in some posting or in the Wiki?
>    

I just added some initial text to http://wiki.qemu.org/Testing.

> Regards,
> Andreas
>
>    

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-05 17:45       ` Stefan Weil
@ 2012-09-20 17:03         ` Stefan Weil
  2012-09-21  8:06           ` Andreas Färber
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Weil @ 2012-09-20 17:03 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Stefan Hajnoczi, Andreas Färber, qemu-devel

Am 05.09.2012 19:45, schrieb Stefan Weil:
> Am 05.09.2012 19:15, schrieb Stefan Weil:
>>
>> 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
>
> Here is some additional information:
>
> binutils switched from GPL 2 to GPL 3 with version 2.18:
>
> Changes in 2.18:
>
> * The binutils sources are now released under version 3 of the GNU 
> General
>   Public License.
>
>
> sparc-dis.c is already based on 2.17, so we won't get anything newer.
> Even the latest version still uses the redundant NULL check, so I
> can send my patch to the binutils maintainers, too.
>
> Regards,
> Stefan
>


Ping? If nobody objects, I suggest to apply the patch via qemu-trivial.

Regards

Stefan W.

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

* Re: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
  2012-09-20 17:03         ` Stefan Weil
@ 2012-09-21  8:06           ` Andreas Färber
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Färber @ 2012-09-21  8:06 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, Stefan Hajnoczi, qemu-devel

Am 20.09.2012 19:03, schrieb Stefan Weil:
> Am 05.09.2012 19:45, schrieb Stefan Weil:
>> Am 05.09.2012 19:15, schrieb Stefan Weil:
>>>
>>> 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
>>
>> Here is some additional information:
>>
>> binutils switched from GPL 2 to GPL 3 with version 2.18:
>>
>> Changes in 2.18:
>>
>> * The binutils sources are now released under version 3 of the GNU
>> General
>>   Public License.
>>
>>
>> sparc-dis.c is already based on 2.17, so we won't get anything newer.
>> Even the latest version still uses the redundant NULL check, so I
>> can send my patch to the binutils maintainers, too.

So did you? And did they accept it?

Regards,
Andreas

> Ping? If nobody objects, I suggest to apply the patch via qemu-trivial.
> 
> Regards
> 
> Stefan W.

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

end of thread, other threads:[~2012-09-21  8:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.