[v2,08/27] i2c: busses: remove memset after dmam_alloc_coherent
diff mbox series

Message ID 20190628024711.15203-1-huangfq.daxian@gmail.com
State Superseded
Headers show
Series
  • Untitled series #116607
Related show

Commit Message

Fuqian Huang June 28, 2019, 2:47 a.m. UTC
In commit af7ddd8a627c
("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
dmam_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/i2c/busses/i2c-ismt.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jarkko Nikula June 28, 2019, 6:22 a.m. UTC | #1
Hi

On 6/28/19 5:47 AM, Fuqian Huang wrote:
> In commit af7ddd8a627c
> ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
> dmam_alloc_coherent has already zeroed the memory.
> So memset is not needed.
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> ---
>   drivers/i2c/busses/i2c-ismt.c | 2 --
>   1 file changed, 2 deletions(-)
> 
It would be better to refer actual commit or commits that implement that 
zeroing rather than merge point in commit log if possible.

At quick look commit 518a2f1925c3 ("dma-mapping: zero memory returned 
from dma_alloc_*") is the one but I'm not really an expert here to say 
is that alone enough.
Wolfram Sang June 29, 2019, 11:12 a.m. UTC | #2
On Fri, Jun 28, 2019 at 09:22:31AM +0300, Jarkko Nikula wrote:
> Hi
> 
> On 6/28/19 5:47 AM, Fuqian Huang wrote:
> > In commit af7ddd8a627c
> > ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
> > dmam_alloc_coherent has already zeroed the memory.
> > So memset is not needed.
> > 
> > Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> > ---
> >   drivers/i2c/busses/i2c-ismt.c | 2 --
> >   1 file changed, 2 deletions(-)
> > 
> It would be better to refer actual commit or commits that implement that
> zeroing rather than merge point in commit log if possible.
> 
> At quick look commit 518a2f1925c3 ("dma-mapping: zero memory returned from
> dma_alloc_*") is the one but I'm not really an expert here to say is that
> alone enough.

Fuqian, can you clarify if the commit pointed by Jarkko is enough as a
reference or if it really needs the merge tag?

Also, please include the tags you collected in v1 when sending v2 (and
there was no significant code change).

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index 02d23edb2fb1..2f95e25a10f7 100644
--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -781,8 +781,6 @@  static int ismt_dev_init(struct ismt_priv *priv)
 	if (!priv->hw)
 		return -ENOMEM;
 
-	memset(priv->hw, 0, (ISMT_DESC_ENTRIES * sizeof(struct ismt_desc)));
-
 	priv->head = 0;
 	init_completion(&priv->cmp);