Commit 392b7bc1 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Linus Torvalds

drivers/char/consolemap.c: kmalloc + memset conversion to kzalloc

 drivers/char/consolemap.c | 22678 -> 22650 (-28 bytes)
 drivers/char/consolemap.o | 90113 -> 90029 (-84 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0b15d04a
...@@ -494,12 +494,11 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) ...@@ -494,12 +494,11 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
if (p && p->readonly) return -EIO; if (p && p->readonly) return -EIO;
if (!p || --p->refcount) { if (!p || --p->refcount) {
q = kmalloc(sizeof(*p), GFP_KERNEL); q = kzalloc(sizeof(*p), GFP_KERNEL);
if (!q) { if (!q) {
if (p) p->refcount++; if (p) p->refcount++;
return -ENOMEM; return -ENOMEM;
} }
memset(q, 0, sizeof(*q));
q->refcount=1; q->refcount=1;
*vc->vc_uni_pagedir_loc = (unsigned long)q; *vc->vc_uni_pagedir_loc = (unsigned long)q;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment