[PATCH] Cleanup: Use kcalloc instead of custom local function.

From: Panagiotis Issaris
Date: Tue Nov 08 2005 - 18:48:48 EST


Cleanup: The statically defined ckmalloc is only used once in the sourcefile and
it can easily be replaced by kcalloc.

Signed-off-by: Panagiotis Issaris <takis@xxxxxxxxxxx>

---

drivers/char/sx.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)

applies-to: 83b352286b6bd3b144b5f9ce337f70505719a088
f3ccf337c07daf203f997608bb528d84ee8388d7
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 3ad758a..fead587 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2279,18 +2279,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;
@@ -2303,7 +2291,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;

---
0.99.9.GIT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/