Re: [PATCH] kernel: use kcalloc instead kmalloc/memset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pekka Enberg <[email protected]> wrote:
>
> This patch converts kernel/ to use kcalloc instead of kmalloc/memset.
>

grr.
 
>  -	struct resource *res = kmalloc(sizeof(*res), GFP_KERNEL);
>  +	struct resource *res = kcalloc(1, sizeof(*res), GFP_KERNEL);

Notice how every conversion you did passes in `1' in the first argument?

And that's going to happen again and again and again.  Each callsite
needlessly passing that silly third argument, adding more kernel text.

If we're going to do this, we should add a two-arg helper function first,
and use that, no?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux