aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 05:38:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:58 -0500
commit4a7cb69badb4ca11fe0ba09aafac5c284922fc8f (patch)
tree4aecbccdfc091d2817b0fd7450e879f2f7117372
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>
-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)
2267 return 0; 2267 return 0;
2268} 2268}
2269 2269
2270
2271static void * ckmalloc (int size)
2272{
2273 void *p;
2274
2275 p = kmalloc(size, GFP_KERNEL);
2276 if (p)
2277 memset(p, 0, size);
2278 return p;
2279}
2280
2281
2282static int sx_init_portstructs (int nboards, int nports) 2270static int sx_init_portstructs (int nboards, int nports)
2283{ 2271{
2284 struct sx_board *board; 2272 struct sx_board *board;
@@ -2291,7 +2279,7 @@ static int sx_init_portstructs (int nboards, int nports)
2291 2279
2292 /* Many drivers statically allocate the maximum number of ports 2280 /* Many drivers statically allocate the maximum number of ports
2293 There is no reason not to allocate them dynamically. Is there? -- REW */ 2281 There is no reason not to allocate them dynamically. Is there? -- REW */
2294 sx_ports = ckmalloc(nports * sizeof (struct sx_port)); 2282 sx_ports = kcalloc(nports, sizeof(struct sx_port), GFP_KERNEL);
2295 if (!sx_ports) 2283 if (!sx_ports)
2296 return -ENOMEM; 2284 return -ENOMEM;
2297 2285