From: Jiri Slaby Date: Fri, 8 Dec 2006 10:38:59 +0000 (-0800) Subject: [PATCH] Char: sx, use kcalloc X-Git-Tag: v2.6.20-rc1~34^2~185 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4a7cb69badb4ca11fe0ba09aafac5c284922fc8f;p=linux-2.6-omap-h63xx.git [PATCH] Char: sx, use kcalloc Convert self-implemented kzalloc to kernel kcalloc. Cc: Signed-off-by: Jiri Slaby Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 5e01337e610..5fb79f59040 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -2267,18 +2267,6 @@ static int sx_init_drivers(void) return 0; } - -static void * ckmalloc (int size) -{ - void *p; - - p = kmalloc(size, GFP_KERNEL); - if (p) - memset(p, 0, size); - return p; -} - - static int sx_init_portstructs (int nboards, int nports) { struct sx_board *board; @@ -2291,7 +2279,7 @@ static int sx_init_portstructs (int nboards, int nports) /* Many drivers statically allocate the maximum number of ports There is no reason not to allocate them dynamically. Is there? -- REW */ - sx_ports = ckmalloc(nports * sizeof (struct sx_port)); + sx_ports = kcalloc(nports, sizeof(struct sx_port), GFP_KERNEL); if (!sx_ports) return -ENOMEM;