From: Simon Horman Date: Thu, 10 Oct 2024 11:04:10 +0000 (+0100) Subject: net: ethernet: ti: am65-cpsw: Use __be64 type for id_temp X-Git-Tag: v6.13-rc1~135^2~337^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5c16e118b796e95d6e5c80c5d8af2591262431c9;p=linux-block.git net: ethernet: ti: am65-cpsw: Use __be64 type for id_temp The id_temp local variable in am65_cpsw_nuss_probe() is used to hold a 64-bit big-endian value as it is assigned using cpu_to_be64(). It is read using memcpy(), where it is written as an identifier into a byte-array. So this can also be treated as big endian. As it's type is currently host byte order (u64), sparse flags an endian mismatch when compiling for little-endian systems: .../am65-cpsw-nuss.c:3454:17: warning: incorrect type in assignment (different base types) .../am65-cpsw-nuss.c:3454:17: expected unsigned long long [usertype] id_temp .../am65-cpsw-nuss.c:3454:17: got restricted __be64 [usertype] Address this by using __be64 as the type of id_temp. No functional change intended. Compile tested only. Reviewed-by: Kalesh AP Reviewed-by: Roger Quadros Signed-off-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index aee98ffcf093..bb3e636b6eae 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -3500,7 +3500,7 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) struct resource *res; struct clk *clk; int ale_entries; - u64 id_temp; + __be64 id_temp; int ret, i; common = devm_kzalloc(dev, sizeof(struct am65_cpsw_common), GFP_KERNEL);