diff mbox series

usb: cdns3: delete repeated clear operations

Message ID 1615603303-14518-1-git-send-email-wangqing@vivo.com
State New
Headers show
Series usb: cdns3: delete repeated clear operations | expand

Commit Message

Qing Wang March 13, 2021, 2:41 a.m. UTC
dma_alloc_coherent already zeroes out memory, so memset is not needed.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/usb/cdns3/cdnsp-mem.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Pawel Laszczak March 22, 2021, 7:19 a.m. UTC | #1
Hi Peter,

Can you add this patch to for-usb-next branch.

Thanks.

>

>

>dma_alloc_coherent already zeroes out memory, so memset is not needed.

>

>Signed-off-by: Wang Qing <wangqing@vivo.com>


Reviewed-by: Pawel Laszczak <pawell@cadence.com>


>---

> drivers/usb/cdns3/cdnsp-mem.c | 1 -

> 1 file changed, 1 deletion(-)

>

>diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c

>index 7a84e92..1d1b9a4

>--- a/drivers/usb/cdns3/cdnsp-mem.c

>+++ b/drivers/usb/cdns3/cdnsp-mem.c

>@@ -1231,7 +1231,6 @@ int cdnsp_mem_init(struct cdnsp_device *pdev)

> 	if (!pdev->dcbaa)

> 		return -ENOMEM;

>

>-	memset(pdev->dcbaa, 0, sizeof(*pdev->dcbaa));

> 	pdev->dcbaa->dma = dma;

>

> 	cdnsp_write_64(dma, &pdev->op_regs->dcbaa_ptr);

>--

>2.7.4


Regards,
Pawel Laszczak
Peter Chen March 27, 2021, 12:55 a.m. UTC | #2
On 21-03-22 07:19:46, Pawel Laszczak wrote:
> Hi Peter,

> 

> Can you add this patch to for-usb-next branch.

> 


Feel free add your ACK base on this patch.

Peter
> Thanks.

> 

> >

> >

> >dma_alloc_coherent already zeroes out memory, so memset is not needed.

> >

> >Signed-off-by: Wang Qing <wangqing@vivo.com>

> 

> Reviewed-by: Pawel Laszczak <pawell@cadence.com>

> 

> >---

> > drivers/usb/cdns3/cdnsp-mem.c | 1 -

> > 1 file changed, 1 deletion(-)

> >

> >diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c

> >index 7a84e92..1d1b9a4

> >--- a/drivers/usb/cdns3/cdnsp-mem.c

> >+++ b/drivers/usb/cdns3/cdnsp-mem.c

> >@@ -1231,7 +1231,6 @@ int cdnsp_mem_init(struct cdnsp_device *pdev)

> > 	if (!pdev->dcbaa)

> > 		return -ENOMEM;

> >

> >-	memset(pdev->dcbaa, 0, sizeof(*pdev->dcbaa));

> > 	pdev->dcbaa->dma = dma;

> >

> > 	cdnsp_write_64(dma, &pdev->op_regs->dcbaa_ptr);

> >--

> >2.7.4

> 

> Regards,

> Pawel Laszczak


-- 

Thanks,
Peter Chen
Pawel Laszczak March 30, 2021, 3:43 a.m. UTC | #3
>

>On 21-03-22 07:19:46, Pawel Laszczak wrote:

>> Hi Peter,

>>

>> Can you add this patch to for-usb-next branch.

>>

>

>Feel free add your ACK base on this patch.

>

>Peter

>> Thanks.

>>

>> >

>> >

>> >dma_alloc_coherent already zeroes out memory, so memset is not needed.

>> >

>> >Signed-off-by: Wang Qing <wangqing@vivo.com>

>>

>> Reviewed-by: Pawel Laszczak <pawell@cadence.com>



Acked-by: Pawel Laszczak <pawell@cadence.com>


>>

>> >---

>> > drivers/usb/cdns3/cdnsp-mem.c | 1 -

>> > 1 file changed, 1 deletion(-)

>> >

>> >diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c

>> >index 7a84e92..1d1b9a4

>> >--- a/drivers/usb/cdns3/cdnsp-mem.c

>> >+++ b/drivers/usb/cdns3/cdnsp-mem.c

>> >@@ -1231,7 +1231,6 @@ int cdnsp_mem_init(struct cdnsp_device *pdev)

>> > 	if (!pdev->dcbaa)

>> > 		return -ENOMEM;

>> >

>> >-	memset(pdev->dcbaa, 0, sizeof(*pdev->dcbaa));

>> > 	pdev->dcbaa->dma = dma;

>> >

>> > 	cdnsp_write_64(dma, &pdev->op_regs->dcbaa_ptr);

>> >--

>> >2.7.4

>>

>> Regards,

>> Pawel Laszczak

>

>--

>

>Thanks,

>Peter Chen


Regards,
Pawel Laszczak
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c
index 7a84e92..1d1b9a4
--- a/drivers/usb/cdns3/cdnsp-mem.c
+++ b/drivers/usb/cdns3/cdnsp-mem.c
@@ -1231,7 +1231,6 @@  int cdnsp_mem_init(struct cdnsp_device *pdev)
 	if (!pdev->dcbaa)
 		return -ENOMEM;
 
-	memset(pdev->dcbaa, 0, sizeof(*pdev->dcbaa));
 	pdev->dcbaa->dma = dma;
 
 	cdnsp_write_64(dma, &pdev->op_regs->dcbaa_ptr);