netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: macsec: Add endianness annotations in salt struct
@ 2025-01-17 11:22 Ales Nezbeda
  2025-01-17 18:18 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ales Nezbeda @ 2025-01-17 11:22 UTC (permalink / raw)
  To: netdev; +Cc: sd, mayflowerera, Ales Nezbeda

This change resolves warning produced by sparse tool as currently
there is a mismatch between normal generic type in salt and endian
annotated type in macsec driver code. Endian annotated types should
be used here.

Sparse output:
warning: restricted ssci_t degrades to integer
warning: incorrect type in assignment (different base types)
    expected restricted ssci_t [usertype] ssci
    got unsigned int
warning: restricted __be64 degrades to integer
warning: incorrect type in assignment (different base types)
    expected restricted __be64 [usertype] pn
    got unsigned long long

Signed-off-by: Ales Nezbeda <anezbeda@redhat.com>
---
 include/net/macsec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/macsec.h b/include/net/macsec.h
index de216cbc6b05..bc7de5b53e54 100644
--- a/include/net/macsec.h
+++ b/include/net/macsec.h
@@ -38,8 +38,8 @@ struct metadata_dst;
 
 typedef union salt {
 	struct {
-		u32 ssci;
-		u64 pn;
+		ssci_t ssci;
+		__be64 pn;
 	} __packed;
 	u8 bytes[MACSEC_SALT_LEN];
 } __packed salt_t;
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: macsec: Add endianness annotations in salt struct
  2025-01-17 11:22 [PATCH net-next] net: macsec: Add endianness annotations in salt struct Ales Nezbeda
@ 2025-01-17 18:18 ` Simon Horman
  2025-01-19 23:19 ` Sabrina Dubroca
  2025-01-20 12:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-01-17 18:18 UTC (permalink / raw)
  To: Ales Nezbeda; +Cc: netdev, sd, mayflowerera

On Fri, Jan 17, 2025 at 12:22:28PM +0100, Ales Nezbeda wrote:
> This change resolves warning produced by sparse tool as currently
> there is a mismatch between normal generic type in salt and endian
> annotated type in macsec driver code. Endian annotated types should
> be used here.
> 
> Sparse output:
> warning: restricted ssci_t degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted ssci_t [usertype] ssci
>     got unsigned int
> warning: restricted __be64 degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted __be64 [usertype] pn
>     got unsigned long long
> 
> Signed-off-by: Ales Nezbeda <anezbeda@redhat.com>

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: macsec: Add endianness annotations in salt struct
  2025-01-17 11:22 [PATCH net-next] net: macsec: Add endianness annotations in salt struct Ales Nezbeda
  2025-01-17 18:18 ` Simon Horman
@ 2025-01-19 23:19 ` Sabrina Dubroca
  2025-01-20 12:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Sabrina Dubroca @ 2025-01-19 23:19 UTC (permalink / raw)
  To: Ales Nezbeda; +Cc: netdev, mayflowerera

2025-01-17, 12:22:28 +0100, Ales Nezbeda wrote:
> This change resolves warning produced by sparse tool as currently
> there is a mismatch between normal generic type in salt and endian
> annotated type in macsec driver code. Endian annotated types should
> be used here.
> 
> Sparse output:
> warning: restricted ssci_t degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted ssci_t [usertype] ssci
>     got unsigned int
> warning: restricted __be64 degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted __be64 [usertype] pn
>     got unsigned long long
> 
> Signed-off-by: Ales Nezbeda <anezbeda@redhat.com>
> ---
>  include/net/macsec.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>

-- 
Sabrina

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: macsec: Add endianness annotations in salt struct
  2025-01-17 11:22 [PATCH net-next] net: macsec: Add endianness annotations in salt struct Ales Nezbeda
  2025-01-17 18:18 ` Simon Horman
  2025-01-19 23:19 ` Sabrina Dubroca
@ 2025-01-20 12:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-20 12:30 UTC (permalink / raw)
  To: Ales Nezbeda; +Cc: netdev, sd, mayflowerera

Hello:

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

On Fri, 17 Jan 2025 12:22:28 +0100 you wrote:
> This change resolves warning produced by sparse tool as currently
> there is a mismatch between normal generic type in salt and endian
> annotated type in macsec driver code. Endian annotated types should
> be used here.
> 
> Sparse output:
> warning: restricted ssci_t degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted ssci_t [usertype] ssci
>     got unsigned int
> warning: restricted __be64 degrades to integer
> warning: incorrect type in assignment (different base types)
>     expected restricted __be64 [usertype] pn
>     got unsigned long long
> 
> [...]

Here is the summary with links:
  - [net-next] net: macsec: Add endianness annotations in salt struct
    https://git.kernel.org/netdev/net-next/c/457bb7970a0f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-20 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 11:22 [PATCH net-next] net: macsec: Add endianness annotations in salt struct Ales Nezbeda
2025-01-17 18:18 ` Simon Horman
2025-01-19 23:19 ` Sabrina Dubroca
2025-01-20 12:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).