diff mbox

[1/2] omap3isp: Remove unneeded memset after kzalloc

Message ID 1356971395-3135-1-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Dec. 31, 2012, 4:29 p.m. UTC
kzalloc initializes the memory it allocates to 0, there's no need for an
explicit memset.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/omap3isp/isph3a_aewb.c |    1 -
 drivers/media/platform/omap3isp/isph3a_af.c   |    1 -
 drivers/media/platform/omap3isp/isphist.c     |    1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

Comments

Sakari Ailus Jan. 4, 2013, 11:05 p.m. UTC | #1
Hi,

Nice patches --- thanks!!

On Mon, Dec 31, 2012 at 05:29:54PM +0100, Laurent Pinchart wrote:
> kzalloc initializes the memory it allocates to 0, there's no need for an
> explicit memset.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Sakari Ailus Jan. 5, 2013, 10:57 p.m. UTC | #2
Sakari Ailus wrote:
> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>

I forgot to mention this applies to both of the patches.
diff mbox

Patch

diff --git a/drivers/media/platform/omap3isp/isph3a_aewb.c b/drivers/media/platform/omap3isp/isph3a_aewb.c
index 036e996..1b908fd 100644
--- a/drivers/media/platform/omap3isp/isph3a_aewb.c
+++ b/drivers/media/platform/omap3isp/isph3a_aewb.c
@@ -306,7 +306,6 @@  int omap3isp_h3a_aewb_init(struct isp_device *isp)
 	if (!aewb_cfg)
 		return -ENOMEM;
 
-	memset(aewb, 0, sizeof(*aewb));
 	aewb->ops = &h3a_aewb_ops;
 	aewb->priv = aewb_cfg;
 	aewb->dma_ch = -1;
diff --git a/drivers/media/platform/omap3isp/isph3a_af.c b/drivers/media/platform/omap3isp/isph3a_af.c
index 42ccce3..d645b41 100644
--- a/drivers/media/platform/omap3isp/isph3a_af.c
+++ b/drivers/media/platform/omap3isp/isph3a_af.c
@@ -369,7 +369,6 @@  int omap3isp_h3a_af_init(struct isp_device *isp)
 	if (af_cfg == NULL)
 		return -ENOMEM;
 
-	memset(af, 0, sizeof(*af));
 	af->ops = &h3a_af_ops;
 	af->priv = af_cfg;
 	af->dma_ch = -1;
diff --git a/drivers/media/platform/omap3isp/isphist.c b/drivers/media/platform/omap3isp/isphist.c
index 2d759c5..da2fa98 100644
--- a/drivers/media/platform/omap3isp/isphist.c
+++ b/drivers/media/platform/omap3isp/isphist.c
@@ -481,7 +481,6 @@  int omap3isp_hist_init(struct isp_device *isp)
 	if (hist_cfg == NULL)
 		return -ENOMEM;
 
-	memset(hist, 0, sizeof(*hist));
 	hist->isp = isp;
 
 	if (HIST_CONFIG_DMA)