Skip to contentSkip to conversation

net: airoha: Fix non-standard return value in airoha_ppe_get_wdma_info()

PATCH Applied Wayen.Yan 3 participants 3 messages Jun 13 – Jun 15

Subsystems (4)
lore
Share & tools
lore

Wayen.Yan

author
#0 lore raw

PATCH 1/1 net: airoha: Fix non-standard return value in airoha_ppe_get_wdma_info()

airoha_ppe_get_wdma_info() returns -1 when the last path in the forwarding path stack is not of type DEV_PATH_MTK_WDMA. This is not a standard kernel error code. Replace it with -EINVAL since the input path type is invalid from the caller's perspective.

Fixes 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
---
 drivers/net/ethernet/airoha/airoha_ppe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/airoha/airoha_ppe.c +1 -1
index 5c9dff6..7260177 100644
@@ -264,7 +264,7 @@ static int airoha_ppe_get_wdma_info(struct net_device *dev, const u8 *addr,
 
 	path = &stack.path[stack.num_paths - 1];
 	if (path->type != DEV_PATH_MTK_WDMA)
-		return -1;
+		return -EINVAL;
 
 	info->idx = path->mtk_wdma.wdma_idx;
 	info->bss = path->mtk_wdma.bss;
Signature · 1 line
2.51.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

airoha_ppe_get_wdma_info() returns -1 when the last path in the forwarding path stack is not of type DEV_PATH_MTK_WDMA. This is not a standard kernel error code. Replace it with -EINVAL since the input path type is invalid from the caller's perspective.

Quoted 24 lines
Fixes 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
---
 drivers/net/ethernet/airoha/airoha_ppe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/airoha/airoha_ppe.c +1 -1
index 5c9dff6..7260177 100644
@@ -264,7 +264,7 @@ static int airoha_ppe_get_wdma_info(struct net_device *dev, const u8 *addr,
 
 	path = &stack.path[stack.num_paths - 1];
 	if (path->type != DEV_PATH_MTK_WDMA)
-		return -1;
+		return -EINVAL;
 
 	info->idx = path->mtk_wdma.wdma_idx;
 	info->bss = path->mtk_wdma.bss;
Signature · 1 line
2.51.0
#2 lore raw
In reply to Wayen.Yan
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sat, 13 Jun 2026 08:22:31 +0800 you wrote:

airoha_ppe_get_wdma_info() returns -1 when the last path in the forwarding path stack is not of type DEV_PATH_MTK_WDMA. This is not a standard kernel error code. Replace it with -EINVAL since the input path type is invalid from the caller's perspective.

Fixes 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")

[...]

Here is the summary with links:
- net: airoha: Fix non-standard return value in airoha_ppe_get_wdma_info()

    https://git.kernel.org/netdev/net-next/c/05173fa30add

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html