Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <anezbeda@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ales Nezbeda and committed by
David S. Miller
457bb797 5fe71fda

+2 -2
+2 -2
include/net/macsec.h
··· 38 38 39 39 typedef union salt { 40 40 struct { 41 - u32 ssci; 42 - u64 pn; 41 + ssci_t ssci; 42 + __be64 pn; 43 43 } __packed; 44 44 u8 bytes[MACSEC_SALT_LEN]; 45 45 } __packed salt_t;