[PATCH 09] drivers/char/consolemap.c: kmalloc + memset conversion to kzalloc

From: Mariusz Kozlowski
Date: Tue Jul 31 2007 - 13:08:40 EST


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

drivers/char/consolemap.c | 22678 -> 22650 (-28 bytes)
drivers/char/consolemap.o | 90113 -> 90029 (-84 bytes)

drivers/char/consolemap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.23-rc1-mm1-a/drivers/char/consolemap.c 2007-07-26 13:07:41.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/char/consolemap.c 2007-07-31 11:24:24.000000000 +0200
@@ -494,12 +494,11 @@ int con_clear_unimap(struct vc_data *vc,
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
if (p && p->readonly) return -EIO;
if (!p || --p->refcount) {
- q = kmalloc(sizeof(*p), GFP_KERNEL);
+ q = kzalloc(sizeof(*p), GFP_KERNEL);
if (!q) {
if (p) p->refcount++;
return -ENOMEM;
}
- memset(q, 0, sizeof(*q));
q->refcount=1;
*vc->vc_uni_pagedir_loc = (unsigned long)q;
} else {
-
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/