mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Cleanup: Use kcalloc instead of custom local function.
@ 2005-11-08 23:47 Panagiotis Issaris
  0 siblings, 0 replies; only message in thread
From: Panagiotis Issaris @ 2005-11-08 23:47 UTC (permalink / raw)
  To: linux-kernel

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@issaris.org>

---

 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-08 23:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-08 23:47 [PATCH] Cleanup: Use kcalloc instead of custom local function Panagiotis Issaris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®