diff mbox series

[net-next] net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum()

Message ID 20240812-mvneta-be16-v1-1-e1ea12234230@kernel.org (mailing list archive)
State Accepted
Commit 29cabacef1024b39506d3acd18cb2e558832bbaf
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 31 this patch: 29
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-13--12-00 (tests: 706)

Commit Message

Simon Horman Aug. 12, 2024, 11:24 a.m. UTC
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.

Signed-off-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcin Wojtas Aug. 12, 2024, 11:45 a.m. UTC | #1
pon., 12 sie 2024 o 13:24 Simon Horman <horms@kernel.org> napisał(a):
>
> 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.
>
> Signed-off-by: Simon Horman <horms@kernel.org>

Reviewed-by: Marcin Wojtas <marcin.s.wojtas@gmail.com>

Thanks,
Marcin

> ---
>  drivers/net/ethernet/marvell/mvneta.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 41894834fb53..d72b2d5f96db 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -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;
>
patchwork-bot+netdevbpf@kernel.org Aug. 14, 2024, 2:30 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 41894834fb53..d72b2d5f96db 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -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;