diff mbox series

net: ethernet: mtk_eth_soc/wed: fix sparse endian warnings

Message ID 20220408085945.64227-1-nbd@nbd.name (mailing list archive)
State Accepted
Commit 4d65f9b6869a756e89172d858671688349e77671
Delegated to: Netdev Maintainers
Headers show
Series net: ethernet: mtk_eth_soc/wed: fix sparse endian warnings | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 4 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: davem@davemloft.net; 9 maintainers not CCed: john@phrozen.org davem@davemloft.net pabeni@redhat.com linux-mediatek@lists.infradead.org Mark-MC.Lee@mediatek.com matthias.bgg@gmail.com sean.wang@mediatek.com kuba@kernel.org linux-arm-kernel@lists.infradead.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 0
netdev/checkpatch warning WARNING: A patch subject line should describe the change not the tool that found it
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Felix Fietkau April 8, 2022, 8:59 a.m. UTC
Descriptor fields are little-endian

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 11, 2022, 10 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  8 Apr 2022 10:59:45 +0200 you wrote:
> Descriptor fields are little-endian
> 
> Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  drivers/net/ethernet/mediatek/mtk_wed.c | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)

Here is the summary with links:
  - net: ethernet: mtk_eth_soc/wed: fix sparse endian warnings
    https://git.kernel.org/netdev/net-next/c/4d65f9b6869a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index f0eacf819cd9..fbe3e112e829 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -144,16 +144,17 @@  mtk_wed_buffer_alloc(struct mtk_wed_device *dev)
 
 		for (s = 0; s < MTK_WED_BUF_PER_PAGE; s++) {
 			u32 txd_size;
+			u32 ctrl;
 
 			txd_size = dev->wlan.init_buf(buf, buf_phys, token++);
 
-			desc->buf0 = buf_phys;
-			desc->buf1 = buf_phys + txd_size;
-			desc->ctrl = FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN0,
-						txd_size) |
-				     FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN1,
-						MTK_WED_BUF_SIZE - txd_size) |
-				     MTK_WDMA_DESC_CTRL_LAST_SEG1;
+			desc->buf0 = cpu_to_le32(buf_phys);
+			desc->buf1 = cpu_to_le32(buf_phys + txd_size);
+			ctrl = FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN0, txd_size) |
+			       FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN1,
+					  MTK_WED_BUF_SIZE - txd_size) |
+			       MTK_WDMA_DESC_CTRL_LAST_SEG1;
+			desc->ctrl = cpu_to_le32(ctrl);
 			desc->info = 0;
 			desc++;
 
@@ -184,12 +185,14 @@  mtk_wed_free_buffer(struct mtk_wed_device *dev)
 
 	for (i = 0, page_idx = 0; i < dev->buf_ring.size; i += MTK_WED_BUF_PER_PAGE) {
 		void *page = page_list[page_idx++];
+		dma_addr_t buf_addr;
 
 		if (!page)
 			break;
 
-		dma_unmap_page(dev->hw->dev, desc[i].buf0,
-			       PAGE_SIZE, DMA_BIDIRECTIONAL);
+		buf_addr = le32_to_cpu(desc[i].buf0);
+		dma_unmap_page(dev->hw->dev, buf_addr, PAGE_SIZE,
+			       DMA_BIDIRECTIONAL);
 		__free_page(page);
 	}