From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sergei Antonov <saproj@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
Paolo Abeni <pabeni@redhat.com>, Sasha Levin <sashal@kernel.org>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 07/16] net: ftmac100: fix endianness-related issues from 'sparse'
Date: Sun, 9 Oct 2022 18:27:03 -0400 [thread overview]
Message-ID: <20221009222713.1220394-7-sashal@kernel.org> (raw)
In-Reply-To: <20221009222713.1220394-1-sashal@kernel.org>
From: Sergei Antonov <saproj@gmail.com>
[ Upstream commit 9df696b3b3a4c96c3219eb87c7bf03fb50e490b8 ]
Sparse found a number of endianness-related issues of these kinds:
.../ftmac100.c:192:32: warning: restricted __le32 degrades to integer
.../ftmac100.c:208:23: warning: incorrect type in assignment (different base types)
.../ftmac100.c:208:23: expected unsigned int rxdes0
.../ftmac100.c:208:23: got restricted __le32 [usertype]
.../ftmac100.c:249:23: warning: invalid assignment: &=
.../ftmac100.c:249:23: left side has type unsigned int
.../ftmac100.c:249:23: right side has type restricted __le32
.../ftmac100.c:527:16: warning: cast to restricted __le32
Change type of some fields from 'unsigned int' to '__le32' to fix it.
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220902113749.1408562-1-saproj@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/faraday/ftmac100.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/faraday/ftmac100.h b/drivers/net/ethernet/faraday/ftmac100.h
index 46a0c47b1ee1..0731d65e856c 100644
--- a/drivers/net/ethernet/faraday/ftmac100.h
+++ b/drivers/net/ethernet/faraday/ftmac100.h
@@ -135,9 +135,9 @@
* Transmit descriptor, aligned to 16 bytes
*/
struct ftmac100_txdes {
- unsigned int txdes0;
- unsigned int txdes1;
- unsigned int txdes2; /* TXBUF_BADR */
+ __le32 txdes0;
+ __le32 txdes1;
+ __le32 txdes2; /* TXBUF_BADR */
unsigned int txdes3; /* not used by HW */
} __attribute__ ((aligned(16)));
@@ -156,9 +156,9 @@ struct ftmac100_txdes {
* Receive descriptor, aligned to 16 bytes
*/
struct ftmac100_rxdes {
- unsigned int rxdes0;
- unsigned int rxdes1;
- unsigned int rxdes2; /* RXBUF_BADR */
+ __le32 rxdes0;
+ __le32 rxdes1;
+ __le32 rxdes2; /* RXBUF_BADR */
unsigned int rxdes3; /* not used by HW */
} __attribute__ ((aligned(16)));
--
2.35.1
next prev parent reply other threads:[~2022-10-09 23:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 22:26 [PATCH AUTOSEL 4.9 01/16] openvswitch: Fix double reporting of drops in dropwatch Sasha Levin
2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 02/16] openvswitch: Fix overreporting " Sasha Levin
2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 03/16] tcp: annotate data-race around tcp_md5sig_pool_populated Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 04/16] xfrm: Update ipcomp_scratches with NULL when freed Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 05/16] net: xscale: Fix return type for implementation of ndo_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 06/16] net: lantiq_etop: " Sasha Levin
2022-10-09 22:27 ` Sasha Levin [this message]
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 08/16] Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 09/16] net: davicom: Fix return type of dm9000_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 10/16] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 11/16] net: korina: Fix return type of korina_send_packet Sasha Levin
2022-10-17 10:25 ` Pavel Machek
2022-10-17 12:50 ` Pavel Machek
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 12/16] Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 13/16] can: bcm: check the result of can_send() in bcm_can_tx() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 14/16] wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620 Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 15/16] Bluetooth: L2CAP: Fix user-after-free Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 16/16] r8152: Rate limit overflow messages Sasha Levin
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=20221009222713.1220394-7-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saproj@gmail.com \
--cc=stable@vger.kernel.org \
/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).