2021-03-13 02:43:47

by 王擎

[permalink] [raw]
Subject: [PATCH] usb: cdns3: delete repeated clear operations

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

Signed-off-by: Wang Qing <[email protected]>
---
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


2021-03-22 07:24:27

by Pawel Laszczak

[permalink] [raw]
Subject: RE: [PATCH] usb: cdns3: delete repeated clear operations

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 <[email protected]>

Reviewed-by: Pawel Laszczak <[email protected]>

>---
> 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

2021-03-27 01:01:52

by Peter Chen

[permalink] [raw]
Subject: Re: [PATCH] usb: cdns3: delete repeated clear operations

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 <[email protected]>
>
> Reviewed-by: Pawel Laszczak <[email protected]>
>
> >---
> > 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

2021-03-30 03:47:08

by Pawel Laszczak

[permalink] [raw]
Subject: RE: [PATCH] usb: cdns3: delete repeated clear operations

>
>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 <[email protected]>
>>
>> Reviewed-by: Pawel Laszczak <[email protected]>


Acked-by: Pawel Laszczak <[email protected]>

>>
>> >---
>> > 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