Re: [PATCH] kernel: use kcalloc instead kmalloc/memset
[Posted August 10, 2005 by corbet]
From: |
| Andrew Morton <akpm-AT-osdl.org> |
To: |
| Pekka Enberg <penberg-AT-cs.helsinki.fi> |
Subject: |
| Re: [PATCH] kernel: use kcalloc instead kmalloc/memset |
Date: |
| Thu, 4 Aug 2005 22:38:42 -0700 |
Cc: |
| linux-kernel-AT-vger.kernel.org |
Pekka Enberg <penberg@cs.helsinki.fi> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/