From: Jiri Slaby Convert self-implemented kzalloc to kernel kcalloc. Cc: Signed-off-by: Jiri Slaby Cc: Alan Cox Signed-off-by: Andrew Morton --- drivers/char/sx.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff -puN drivers/char/sx.c~char-sx-use-kcalloc drivers/char/sx.c --- a/drivers/char/sx.c~char-sx-use-kcalloc +++ a/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 nboa /* 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; _