[PATCH 71] kernel/sched.c: kmalloc + memset conversion to kcalloc

From: Mariusz Kozlowski
Date: Tue Jul 31 2007 - 18:03:58 EST


Signed-off-by: Mariusz Kozlowski <m.kozlowski@xxxxxxxxxx>

kernel/sched.c | 166559 -> 166517 (-42 bytes)
kernel/sched.o | 445965 -> 445941 (-24 bytes)

kernel/sched.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.23-rc1-mm1-a/kernel/sched.c 2007-07-26 13:07:44.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/kernel/sched.c 2007-07-31 15:10:55.000000000 +0200
@@ -5167,10 +5167,10 @@ static struct ctl_table sd_ctl_root[] =

static struct ctl_table *sd_alloc_ctl_entry(int n)
{
- struct ctl_table *entry =
- kmalloc(n * sizeof(struct ctl_table), GFP_KERNEL);
+ struct ctl_table *entry;
+
+ entry = kcalloc(n, sizeof(struct ctl_table), GFP_KERNEL);
BUG_ON(!entry);
- memset(entry, 0, n * sizeof(struct ctl_table));
return entry;
}

-
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/