linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: linux-wireless@vger.kernel.org
Cc: xl@wp.pl
Subject: [PATCH 3/4] wifi: cw1200: fix __le16 sparse warnings
Date: Tue, 30 Jan 2024 17:15:55 +0200	[thread overview]
Message-ID: <20240130151556.2315951-4-kvalo@kernel.org> (raw)
In-Reply-To: <20240130151556.2315951-1-kvalo@kernel.org>

Sparse warns:

drivers/net/wireless/st/cw1200/cw1200_spi.c:83:17:    got restricted __le16 [usertype]
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17:    expected unsigned short [addressable] [assigned] [usertype] regaddr
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17:    got restricted __le16 [usertype]

These cpu_to_le16() calls are not really making any sense to me. On a big
endian system we first convert regaddr from big to little using cpu_to_le16()
but immediately after we convert them back to big endian? So just remove them.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
---
 drivers/net/wireless/st/cw1200/cw1200_spi.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c
index c82c0688b549..b27b57fc25bc 100644
--- a/drivers/net/wireless/st/cw1200/cw1200_spi.c
+++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c
@@ -79,9 +79,6 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,
 	pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr, regaddr);
 #endif
 
-	/* Header is LE16 */
-	regaddr = 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
 	*/
@@ -144,9 +141,6 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self,
 	pr_info("WRITE: %04d  to  0x%02x (%04x)\n", count, addr, regaddr);
 #endif
 
-	/* Header is LE16 */
-	regaddr = 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
 	*/
-- 
2.39.2


  parent reply	other threads:[~2024-01-30 15:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 15:15 [PATCH 0/4] wifi: drivers: fix some sparse warnings Kalle Valo
2024-01-30 15:15 ` [PATCH 1/4] wifi: zd1211rw: remove __nocast from zd_addr_t Kalle Valo
2024-02-05 18:16   ` Kalle Valo
2024-01-30 15:15 ` [PATCH 2/4] wifi: rsi: fix restricted __le32 degrades to integer sparse warnings Kalle Valo
2024-01-30 15:15 ` Kalle Valo [this message]
2024-01-30 15:15 ` [PATCH 4/4] wifi: rt2x00: fix __le32 " Kalle Valo
2024-01-31  7:48   ` Kalle Valo
2024-02-03 12:35     ` Stanislaw Gruszka
2024-02-28  9:44       ` Kalle Valo
2024-03-02  8:01         ` Stanislaw Gruszka

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=20240130151556.2315951-4-kvalo@kernel.org \
    --to=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=xl@wp.pl \
    /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).