From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Cc: <R.E.Wolff@BitWizard.nl>
Cc: <support@specialix.co.uk>
Subject: [PATCH 2/5] Char: sx, use kcalloc
Date: Sun, 22 Oct 2006 02:56:45 +0200 (CEST) [thread overview]
Message-ID: <1731170312466312033@wsc.cz> (raw)
sx, use kcalloc
Convert self-implemented kzalloc to kernel kcalloc.
Cc: <R.E.Wolff@BitWizard.nl>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit 52aaf84368d81de72e1c4a69756b10ec744fbeab
tree 58d6c89c8c3628ccd0ee85ebc636f8cfce2039cb
parent 56b6b52313a48cbda4c84bd35252337063269d88
author Jiri Slaby <jirislaby@gmail.com> Sun, 22 Oct 2006 01:55:11 +0200
committer Jiri Slaby <jirislaby@gmail.com> Sun, 22 Oct 2006 01:55:11 +0200
drivers/char/sx.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 9b800bd..be6fff2 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 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;
reply other threads:[~2006-10-22 0:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1731170312466312033@wsc.cz \
--to=jirislaby@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox