All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
Cc: "Doyu Hiroshi (Nokia-D/Helsinki)" <hiroshi.doyu@nokia.com>,
	"Palande Ameya (Nokia-D/Helsinki)" <ameya.palande@nokia.com>,
	"x0095840@ti.com" <x0095840@ti.com>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [DSPBRIGDE PATCH 5/6] dsp: brigde: remove unnecessary memset()
Date: Fri, 21 Aug 2009 13:29:57 +0300	[thread overview]
Message-ID: <20090821102957.GI31549@nokia.com> (raw)
In-Reply-To: <1250850219-25545-6-git-send-email-felipe.balbi@nokia.com>

Hi,

On Fri, Aug 21, 2009 at 12:23:38PM +0200, Balbi Felipe (Nokia-D/Helsinki) wrote:
> bridge_device is static and thus doesn't need
> to be zero-initialized.
> 
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>

I changed this patch to the following:

==== cut here =====


>From 1a5699476007fdff6beb5a895c74bc15f0bdd223 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Fri, 21 Aug 2009 12:10:00 +0300
Subject: [DSPBRIGDE PATCH 5/6] dsp: brigde: convert kmalloc() memset() to kzalloc()

use kzalloc() instead of manually kmalloc() + memset() later.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/dsp/bridge/rmgr/drv_interface.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
index 7763346..27e293b 100755
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -329,13 +329,12 @@ static int __init bridge_init(void)
 
 	driver_major = MAJOR(dev);
 
-	bridge_device = kmalloc(sizeof(struct bridge_dev), GFP_KERNEL);
+	bridge_device = kzalloc(sizeof(struct bridge_dev), GFP_KERNEL);
 	if (!bridge_device) {
 		result = -ENOMEM;
 		unregister_chrdev_region(dev, 1);
 		return result;
 	}
-	memset(bridge_device, 0, sizeof(struct bridge_dev));
 	cdev_init(&bridge_device->cdev, &bridge_fops);
 	bridge_device->cdev.owner = THIS_MODULE;
 	bridge_device->cdev.ops = &bridge_fops;
-- 
1.6.3.3.385.g60647



-- 
balbi

  parent reply	other threads:[~2009-08-21 10:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 10:23 [DSPBRIGDE PATCH 0/6] trivial dsp patches Felipe Balbi
2009-08-21 10:23 ` [DSPBRIGDE PATCH 1/6] dsp: bridge: use ARRAY_SIZE Felipe Balbi
2009-08-21 10:23   ` [DSPBRIGDE PATCH 2/6] dsp: bridge: wcd: else is unnecessary Felipe Balbi
2009-08-21 10:23     ` [DSPBRIGDE PATCH 3/6] dsp: bridge: rename Kbuild to Makefile Felipe Balbi
2009-08-21 10:23       ` [DSPBRIGDE PATCH 4/6] dsp: bridge: always use dynamic major/minor numbers Felipe Balbi
2009-08-21 10:23         ` [DSPBRIGDE PATCH 5/6] dsp: brigde: remove unnecessary memset() Felipe Balbi
2009-08-21 10:23           ` [DSPBRIGDE PATCH 6/6] dsp: bridge: beautify erro path Felipe Balbi
2009-08-28 20:58             ` Guzman Lugo, Fernando
2009-08-28 21:13               ` Andy Shevchenko
2009-08-28 22:31                 ` Guzman Lugo, Fernando
2009-08-29  7:18                   ` Andy Shevchenko
2009-08-31 19:50                     ` Guzman Lugo, Fernando
2009-08-31 21:54                       ` Felipe Balbi
2009-08-21 10:29           ` Felipe Balbi [this message]
2009-08-28 20:55             ` [DSPBRIGDE PATCH 5/6] dsp: brigde: remove unnecessary memset() Guzman Lugo, Fernando
2009-08-28 20:58         ` [DSPBRIGDE PATCH 4/6] dsp: bridge: always use dynamic major/minor numbers Guzman Lugo, Fernando
2009-08-31 20:10       ` [DSPBRIGDE PATCH 3/6] dsp: bridge: rename Kbuild to Makefile Guzman Lugo, Fernando
2009-08-28 20:57     ` [DSPBRIGDE PATCH 2/6] dsp: bridge: wcd: else is unnecessary Guzman Lugo, Fernando
2009-08-28 20:57   ` [DSPBRIGDE PATCH 1/6] dsp: bridge: use ARRAY_SIZE Guzman Lugo, Fernando

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=20090821102957.GI31549@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=hiroshi.doyu@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=x0095840@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.