diff mbox series

[4/5] wifi: cw1200: silence sparse warnings

Message ID 20240223114023.94a005ba767e.I7039051d0aa62fa992afeeec679174c606ef37e8@changeid (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show
Series [1/5] wifi: b43: silence sparse warnings | expand

Commit Message

Johannes Berg Feb. 23, 2024, 10:40 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

This code clearly intends to do some unorthodox byte
order conversions, so add casts to silence sparse.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/st/cw1200/cw1200_spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c
index c82c0688b549..0ce9a1d39db1 100644
--- a/drivers/net/wireless/st/cw1200/cw1200_spi.c
+++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c
@@ -80,7 +80,7 @@  static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,
 #endif
 
 	/* Header is LE16 */
-	regaddr = cpu_to_le16(regaddr);
+	regaddr = (__force u16)cpu_to_le16(regaddr);
 
 	/* We have to byteswap if the SPI bus is limited to 8b operation
 	   or we are running on a Big Endian system
@@ -145,7 +145,7 @@  static int cw1200_spi_memcpy_toio(struct hwbus_priv *self,
 #endif
 
 	/* Header is LE16 */
-	regaddr = cpu_to_le16(regaddr);
+	regaddr = (__force u16)cpu_to_le16(regaddr);
 
 	/* We have to byteswap if the SPI bus is limited to 8b operation
 	   or we are running on a Big Endian system