From: Ales Nezbeda Date: Fri, 17 Jan 2025 11:22:28 +0000 (+0100) Subject: net: macsec: Add endianness annotations in salt struct X-Git-Tag: v6.14-rc1~162^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=457bb7970a0f10effd6b4ca9e1057727963c473a;p=thirdparty%2Fkernel%2Flinux.git net: macsec: Add endianness annotations in salt struct 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 Reviewed-by: Simon Horman Reviewed-by: Sabrina Dubroca Signed-off-by: David S. Miller --- diff --git a/include/net/macsec.h b/include/net/macsec.h index de216cbc6b059..bc7de5b53e543 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;