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

From: Andrew Morton
Date: Fri Aug 05 2005 - 00:41:58 EST


Pekka Enberg <penberg@xxxxxxxxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/