Skip to contentSkip to conversation

net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum()

PATCH Applied Simon Horman 3 participants 3 messages Aug 12, 2024 – Aug 14, 2024

Subsystems (3)
lore
Share & tools
lore

Simon Horman

author reviewer
#0 lore raw

PATCH 1/1 net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum()

The value passed as the l3_proto argument of mvneta_txq_desc_csum() is __be16. And mvneta_txq_desc_csum uses this parameter as a __be16 value. So use __be16 as the type for the parameter, rather than type with host byte order.

Flagged by Sparse as:

.../mvneta.c:1796:25: warning: restricted __be16 degrades to integer .../mvneta.c:1979:45: warning: incorrect type in argument 2 (different base types)
.../mvneta.c:1979:45: expected int l3_proto
.../mvneta.c:1979:45: got restricted __be16 [usertype] l3_proto

No functional change intended.
Flagged by Sparse.

---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index 41894834fb53..d72b2d5f96db 100644
@@ -1781,7 +1781,7 @@ static int mvneta_txq_sent_desc_proc(struct mvneta_port *pp,
 }
 
 /* Set TXQ descriptors fields relevant for CSUM calculation */
-static u32 mvneta_txq_desc_csum(int l3_offs, int l3_proto,
+static u32 mvneta_txq_desc_csum(int l3_offs, __be16 l3_proto,
 				int ip_hdr_len, int l4_proto)
 {
 	u32 command;
maintainer Reviewed-by on v1 1/1
#1 lore raw

pon., 12 sie 2024 o 13:24 Simon Horman <[email protected]> napisał(a):

Quoted 13 lines

The value passed as the l3_proto argument of mvneta_txq_desc_csum() is __be16. And mvneta_txq_desc_csum uses this parameter as a __be16 value. So use __be16 as the type for the parameter, rather than type with host byte order.

Flagged by Sparse as:

.../mvneta.c:1796:25: warning: restricted __be16 degrades to integer .../mvneta.c:1979:45: warning: incorrect type in argument 2 (different base types)
.../mvneta.c:1979:45: expected int l3_proto
.../mvneta.c:1979:45: got restricted __be16 [usertype] l3_proto

Quoted 4 lines

No functional change intended.
Flagged by Sparse.

Thanks,
Marcin

Quoted 18 lines
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index 41894834fb53..d72b2d5f96db 100644
@@ -1781,7 +1781,7 @@ static int mvneta_txq_sent_desc_proc(struct mvneta_port *pp,
 }
 
 /* Set TXQ descriptors fields relevant for CSUM calculation */
-static u32 mvneta_txq_desc_csum(int l3_offs, int l3_proto,
+static u32 mvneta_txq_desc_csum(int l3_offs, __be16 l3_proto,
                                int ip_hdr_len, int l4_proto)
 {
        u32 command;
#2 lore raw
In reply to Simon Horman
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 8 lines · On Mon, 12 Aug 2024 12:24:13 +0100 you wrote:

The value passed as the l3_proto argument of mvneta_txq_desc_csum() is __be16. And mvneta_txq_desc_csum uses this parameter as a __be16 value. So use __be16 as the type for the parameter, rather than type with host byte order.

Flagged by Sparse as:

[...]

Here is the summary with links:
- [net-next] net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum()

    https://git.kernel.org/netdev/net-next/c/29cabacef102

You are awesome, thank you!

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