summaryrefslogtreecommitdiff
path: root/rust/helpers/build_bug.c
diff options
context:
space:
mode:
authorThéo Lebrun <theo.lebrun@bootlin.com>2025-09-23 18:00:27 +0200
committerJakub Kicinski <kuba@kernel.org>2025-09-26 17:54:51 -0700
commit70a5ce8bc94545ba0fb47b2498bfb12de2132f4d (patch)
treeb6ee4df712203aa4a5c3fe653a58ef71e30b578c /rust/helpers/build_bug.c
parent78d901897b3cae06b38f54e48a2378cf9da21175 (diff)
net: macb: avoid dealing with endianness in macb_set_hwaddr()
bp->dev->dev_addr is of type `unsigned char *`. Casting it to a u32 pointer and dereferencing implies dealing manually with endianness, which is error-prone. Replace by calls to get_unaligned_le32|le16() helpers. This was found using sparse: ⟩ make C=2 drivers/net/ethernet/cadence/macb_main.o warning: incorrect type in assignment (different base types) expected unsigned int [usertype] bottom got restricted __le32 [usertype] warning: incorrect type in assignment (different base types) expected unsigned short [usertype] top got restricted __le16 [usertype] ... Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250923-macb-fixes-v6-5-772d655cdeb6@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions