diff mbox series

[3/5] wifi: rt2x00: silence sparse warnings

Message ID 20240223114023.ce0c714124e9.I2b5710b761f63522574fbe7654d37151c31e0b77@changeid
State New
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>

Clearly writing __le32 was intended here, so just put the
right casts into the code to silence sparse about it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stanislaw Gruszka March 2, 2024, 8:01 a.m. UTC | #1
On Fri, Feb 23, 2024 at 11:40:25AM +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Clearly writing __le32 was intended here, so just put the
> right casts into the code to silence sparse about it.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index aaf31857ae1e..3bb81bcff0ac 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -10946,13 +10946,13 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i)
>  	/* Apparently the data is read from end to start */
>  	reg = rt2800_register_read_lock(rt2x00dev, efuse_data3_reg);
>  	/* The returned value is in CPU order, but eeprom is le */
> -	*(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
> +	*(__le32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
>  	reg = rt2800_register_read_lock(rt2x00dev, efuse_data2_reg);
> -	*(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
> +	*(__le32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
>  	reg = rt2800_register_read_lock(rt2x00dev, efuse_data1_reg);
> -	*(u32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg);
> +	*(__le32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg);
>  	reg = rt2800_register_read_lock(rt2x00dev, efuse_data0_reg);
> -	*(u32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg);
> +	*(__le32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg);
>  
>  	mutex_unlock(&rt2x00dev->csr_mutex);
>  }
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index aaf31857ae1e..3bb81bcff0ac 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -10946,13 +10946,13 @@  static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i)
 	/* Apparently the data is read from end to start */
 	reg = rt2800_register_read_lock(rt2x00dev, efuse_data3_reg);
 	/* The returned value is in CPU order, but eeprom is le */
-	*(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
+	*(__le32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
 	reg = rt2800_register_read_lock(rt2x00dev, efuse_data2_reg);
-	*(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
+	*(__le32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
 	reg = rt2800_register_read_lock(rt2x00dev, efuse_data1_reg);
-	*(u32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg);
+	*(__le32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg);
 	reg = rt2800_register_read_lock(rt2x00dev, efuse_data0_reg);
-	*(u32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg);
+	*(__le32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg);
 
 	mutex_unlock(&rt2x00dev->csr_mutex);
 }