From: Alexander Beregalov <a.beregalov@gmail.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org,
Alexander Beregalov <a.beregalov@gmail.com>
Subject: [PATCH next 4/5] staging: ft1000: optimize kmalloc to kzalloc
Date: Wed, 9 Mar 2011 03:53:37 +0300 [thread overview]
Message-ID: <1299632018-6774-4-git-send-email-a.beregalov@gmail.com> (raw)
In-Reply-To: <1299632018-6774-1-git-send-email-a.beregalov@gmail.com>
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c
index 874919c..10af477 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c
@@ -120,11 +120,10 @@ static int ft1000_attach(struct pcmcia_device *link)
DEBUG(0, "ft1000_cs: ft1000_attach()\n");
- local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
+ local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local) {
return -ENOMEM;
}
- memset(local, 0, sizeof(local_info_t));
local->link = link;
link->priv = local;
--
1.7.4.1
next prev parent reply other threads:[~2011-03-09 0:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 0:53 [PATCH next 1/5] staging: bcm: " Alexander Beregalov
2011-03-09 0:53 ` [PATCH next 2/5] staging: brcm80211: " Alexander Beregalov
2011-03-09 0:53 ` [PATCH next 3/5] staging: spectra: " Alexander Beregalov
2011-03-09 0:53 ` Alexander Beregalov [this message]
2011-03-09 0:53 ` [PATCH next 5/5] staging: rts_pstor: " Alexander Beregalov
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=1299632018-6774-4-git-send-email-a.beregalov@gmail.com \
--to=a.beregalov@gmail.com \
--cc=gregkh@suse.de \
--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
all inboxes | Powered by JetHome®