[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1299632018-6774-4-git-send-email-a.beregalov@gmail.com>
Date: Wed, 9 Mar 2011 03:53:37 +0300
From: Alexander Beregalov <a.beregalov@...il.com>
To: gregkh@...e.de
Cc: linux-kernel@...r.kernel.org,
Alexander Beregalov <a.beregalov@...il.com>
Subject: [PATCH next 4/5] staging: ft1000: optimize kmalloc to kzalloc
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.
Signed-off-by: Alexander Beregalov <a.beregalov@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists