diff mbox series

wireless: Use dma_zalloc_coherent instead of dma_alloc_coherent + memset

Message ID 1534604707-10874-1-git-send-email-zhongjiang@huawei.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show
Series wireless: Use dma_zalloc_coherent instead of dma_alloc_coherent + memset | expand

Commit Message

zhong jiang Aug. 18, 2018, 3:05 p.m. UTC
dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset (),
We prefer to dma_zalloc_coherent instead of open-codeing.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Kalle Valo Aug. 18, 2018, 6:29 p.m. UTC | #1
zhong jiang <zhongjiang@huawei.com> writes:

> dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset (),
> We prefer to dma_zalloc_coherent instead of open-codeing.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

The correct prefix is "wcn36xx: ", not "wireless:". I can fix it this
time.

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong
Kalle Valo Aug. 18, 2018, 6:31 p.m. UTC | #2
Kalle Valo <kvalo@codeaurora.org> writes:

> zhong jiang <zhongjiang@huawei.com> writes:
>
>> dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset (),
>> We prefer to dma_zalloc_coherent instead of open-codeing.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> The correct prefix is "wcn36xx: ", not "wireless:". I can fix it this
> time.
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong

Actually please resend this patch and CC linux-wireless so that
patchwork sees this.

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#who_to_address
zhong jiang Aug. 20, 2018, 10:53 a.m. UTC | #3
On 2018/8/19 2:31, Kalle Valo wrote:
> Kalle Valo <kvalo@codeaurora.org> writes:
>
>> zhong jiang <zhongjiang@huawei.com> writes:
>>
>>> dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset (),
>>> We prefer to dma_zalloc_coherent instead of open-codeing.
>>>
>>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>>> ---
>>>  drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++----
>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>> The correct prefix is "wcn36xx: ", not "wireless:". I can fix it this
>> time.
>>
>> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong
> Actually please resend this patch and CC linux-wireless so that
> patchwork sees this.
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#who_to_address
>
 Thanks. I will resend it in v2.

Best wishes,
zhong jiang
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 06cfe8d..e66ddaa 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -174,13 +174,11 @@  static int wcn36xx_dxe_init_descs(struct device *dev, struct wcn36xx_dxe_ch *wcn
 	int i;
 
 	size = wcn_ch->desc_num * sizeof(struct wcn36xx_dxe_desc);
-	wcn_ch->cpu_addr = dma_alloc_coherent(dev, size, &wcn_ch->dma_addr,
-					      GFP_KERNEL);
+	wcn_ch->cpu_addr = dma_zalloc_coherent(dev, size, &wcn_ch->dma_addr,
+					       GFP_KERNEL);
 	if (!wcn_ch->cpu_addr)
 		return -ENOMEM;
 
-	memset(wcn_ch->cpu_addr, 0, size);
-
 	cur_dxe = (struct wcn36xx_dxe_desc *)wcn_ch->cpu_addr;
 	cur_ctl = wcn_ch->head_blk_ctl;