From: Simon Horman <horms@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>,
Roger Quadros <rogerq@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>
Cc: netdev@vger.kernel.org, linux-omap@vger.kernel.org,
llvm@lists.linux.dev
Subject: [PATCH net-next 2/3] net: ethernet: ti: am65-cpsw: Use __be64 type for id_temp
Date: Tue, 10 Sep 2024 08:17:57 +0100 [thread overview]
Message-ID: <20240910-ti-warn-v1-2-afd1e404abbe@kernel.org> (raw)
In-Reply-To: <20240910-ti-warn-v1-0-afd1e404abbe@kernel.org>
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.
Signed-off-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index a4b0e4bb7529..9e6353e0361e 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -3444,7 +3444,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);
--
2.45.2
next prev parent reply other threads:[~2024-09-10 7:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 7:17 [PATCH net-next 0/3] net: ethernet: ti: Address some warnings Simon Horman
2024-09-10 7:17 ` [PATCH net-next 1/3] net: ethernet: ti: am65-cpsw: Address __percpu Sparse warnings Simon Horman
2024-09-12 0:06 ` Jakub Kicinski
2024-09-12 9:58 ` Simon Horman
2024-09-12 15:45 ` Jakub Kicinski
2024-09-12 19:48 ` Simon Horman
2024-09-10 7:17 ` Simon Horman [this message]
2024-09-10 8:42 ` [PATCH net-next 2/3] net: ethernet: ti: am65-cpsw: Use __be64 type for id_temp Kalesh Anakkur Purayil
2024-09-12 7:10 ` Roger Quadros
2024-09-10 7:17 ` [PATCH net-next 3/3] net: ethernet: ti: cpsw_ale: Remove unused accessor functions Simon Horman
2024-09-12 7:07 ` Roger Quadros
2024-09-12 8:59 ` Simon Horman
2024-09-12 10:54 ` Roger Quadros
2024-09-12 11:27 ` Simon Horman
2024-09-12 13:29 ` Roger Quadros
2024-09-12 15:43 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240910-ti-warn-v1-2-afd1e404abbe@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).