From: Felipe Balbi <felipe.balbi@nokia.com>
To: tony@atomide.com
Cc: linux-omap@vger.kernel.org, Felipe Balbi <me@felipebalbi.com>
Subject: [CBUS PATCH 2/2] cbus: switch kmalloc() + memset() to kzalloc()
Date: Sat, 1 May 2010 21:01:10 +0300 [thread overview]
Message-ID: <1272736870-5216-2-git-send-email-felipe.balbi@nokia.com> (raw)
In-Reply-To: <1272736870-5216-1-git-send-email-felipe.balbi@nokia.com>
From: Felipe Balbi <me@felipebalbi.com>
no functional changes, just using kzalloc().
compile tested with n8x0_defconfig and n770_defconfig
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
---
drivers/cbus/retu-user.c | 6 +++---
drivers/cbus/tahvo-usb.c | 4 ++--
drivers/cbus/tahvo-user.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/cbus/retu-user.c b/drivers/cbus/retu-user.c
index 1a29492..953d92a 100644
--- a/drivers/cbus/retu-user.c
+++ b/drivers/cbus/retu-user.c
@@ -382,12 +382,12 @@ int retu_user_init(void)
struct retu_irq *irq;
int res, i;
- irq = kmalloc(sizeof(*irq) * RETU_MAX_IRQ_BUF_LEN, GFP_KERNEL);
+ irq = kzalloc(sizeof(*irq) * RETU_MAX_IRQ_BUF_LEN, GFP_KERNEL);
if (irq == NULL) {
- printk(KERN_ERR PFX "kmalloc failed\n");
+ printk(KERN_ERR PFX "kzalloc failed\n");
return -ENOMEM;
}
- memset(irq, 0, sizeof(*irq) * RETU_MAX_IRQ_BUF_LEN);
+
for (i = 0; i < RETU_MAX_IRQ_BUF_LEN; i++)
list_add(&irq[i].node, &retu_irqs_reserve);
diff --git a/drivers/cbus/tahvo-usb.c b/drivers/cbus/tahvo-usb.c
index ef9fc37..5a344b6 100644
--- a/drivers/cbus/tahvo-usb.c
+++ b/drivers/cbus/tahvo-usb.c
@@ -655,10 +655,10 @@ static int tahvo_usb_probe(struct device *dev)
dev_dbg(dev, "probe\n");
/* Create driver data */
- tu = kmalloc(sizeof(*tu), GFP_KERNEL);
+ tu = kzalloc(sizeof(*tu), GFP_KERNEL);
if (!tu)
return -ENOMEM;
- memset(tu, 0, sizeof(*tu));
+
tu->pt_dev = container_of(dev, struct platform_device, dev);
#ifdef CONFIG_USB_OTG
/* Default mode */
diff --git a/drivers/cbus/tahvo-user.c b/drivers/cbus/tahvo-user.c
index 01e7f20..bd30f06 100644
--- a/drivers/cbus/tahvo-user.c
+++ b/drivers/cbus/tahvo-user.c
@@ -364,12 +364,12 @@ int tahvo_user_init(void)
struct tahvo_irq *irq;
int res, i;
- irq = kmalloc(sizeof(*irq) * TAHVO_MAX_IRQ_BUF_LEN, GFP_KERNEL);
+ irq = kzalloc(sizeof(*irq) * TAHVO_MAX_IRQ_BUF_LEN, GFP_KERNEL);
if (irq == NULL) {
- printk(KERN_ERR PFX "kmalloc failed\n");
+ printk(KERN_ERR PFX "kzalloc failed\n");
return -ENOMEM;
}
- memset(irq, 0, sizeof(*irq) * TAHVO_MAX_IRQ_BUF_LEN);
+
for (i = 0; i < TAHVO_MAX_IRQ_BUF_LEN; i++)
list_add(&irq[i].node, &tahvo_irqs_reserve);
--
1.7.1.rc2.7.g3e7f1
next prev parent reply other threads:[~2010-05-01 18:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-01 18:01 [CBUS PATCH 1/2] cbus: fix compilation with current mainline Felipe Balbi
2010-05-01 18:01 ` Felipe Balbi [this message]
2010-05-03 7:15 ` [CBUS PATCH 2/2] cbus: switch kmalloc() + memset() to kzalloc() Jarkko Nikula
2010-05-04 1:19 ` [APPLIED] " Tony Lindgren
2010-05-03 7:15 ` [CBUS PATCH 1/2] cbus: fix compilation with current mainline Jarkko Nikula
2010-05-04 1:19 ` [APPLIED] " Tony Lindgren
2010-05-05 15:05 ` [CBUS PATCH 1/1] CBUS: Fix broken compilation Carlos Chinea
2010-05-05 18:38 ` Felipe Balbi
2010-05-05 19:00 ` Felipe Balbi
2010-05-06 8:25 ` Carlos Chinea
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=1272736870-5216-2-git-send-email-felipe.balbi@nokia.com \
--to=felipe.balbi@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=tony@atomide.com \
/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;
as well as URLs for NNTP newsgroup(s).