aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby2006-12-08 02:38:59 -0800
committerLinus Torvalds2006-12-08 08:28:58 -0800
commit4a7cb69badb4ca11fe0ba09aafac5c284922fc8f (patch)
tree4aecbccdfc091d2817b0fd7450e879f2f7117372 /drivers
parent5572e10323a7d3cdccf639225553a6e2542049bd (diff)
[PATCH] Char: sx, use kcalloc
Convert self-implemented kzalloc to kernel kcalloc. Cc: <R.E.Wolff@BitWizard.nl> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/sx.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 5e01337e6107..5fb79f59040f 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;