Re: [PATCH 20/56] inflate: Remove void casts

From: Bert Wesarg
Date: Wed Apr 08 2009 - 08:01:06 EST


On Wed, Apr 8, 2009 at 13:21, Jack Stone <jwjstone@xxxxxxxxxxx> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <jwjstone@xxxxxxxxxxx>
> ---
> Â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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/