lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49DCB26C.3070709@bfs.de>
Date:	Wed, 08 Apr 2009 16:19:24 +0200
From:	walter harms <wharms@....de>
To:	Bert Wesarg <bert.wesarg@...glemail.com>
Cc:	Jack Stone <jwjstone@...tmail.fm>, linux-kernel@...r.kernel.org,
	jeff@...zik.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 20/56] inflate: Remove void casts



Bert Wesarg schrieb:
> On Wed, Apr 8, 2009 at 13:21, Jack Stone <jwjstone@...tmail.fm> wrote:
>> Remove uneeded void casts
>>
>> Signed-Off-By: Jack Stone <jwjstone@...tmail.fm>
>> ---
>>  lib/inflate.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/inflate.c b/lib/inflate.c
>> index 1a8e8a9..4b672f9 100644
>> --- a/lib/inflate.c
>> +++ b/lib/inflate.c
>> @@ -249,7 +249,7 @@ static void *malloc(int size)
>>
>>        malloc_ptr = (malloc_ptr + 3) & ~3;     /* Align */
>>
>> -       p = (void *)malloc_ptr;
>> +       p = malloc_ptr;
>>        malloc_ptr += size;
>>
>>        if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
>> @@ -481,7 +481,7 @@ DEBG1("3 ");
>>         z = 1 << j;             /* table entries for j-bit table */
>>
>>         /* allocate and link in new table */
>> -        if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
>> +        if ((q = malloc((z + 1)*sizeof(struct huft))) ==
>>             (struct huft *)NULL)
> Thats an unneeded cast too. (After that, the NULL can move up one line.)
> 
> Bert
>>         {
>>           if (h)

and move the q= from the if. less than half the size.

q = malloc( (z + 1)*sizeof(*q) ):
if ( q == NULL )

re,
 wh





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ