Skip to contentSkip to conversation

staging: rtl8723au: use proper typecast in assignment

PATCH In review Anatoly Stepanov 2 participants 2 messages Dec 14, 2015 – Dec 15, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723au: use proper typecast in assignment

This resolves the following Sparse warning:
"incorrect type in assignment (different base types)"

---
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +1 -1
index 1662c03c..fdd9cf1 100644
@@ -115,7 +115,7 @@ exit:
 
 int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)
 {
-	*((u32 *)param) = cpu_to_le32(*((u32 *)param));
+	*((__le32 *)param) = cpu_to_le32(*((u32 *)param));
 
 	FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param);
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 13 lines · Anatoly Stepanov

This resolves the following Sparse warning:
"incorrect type in assignment (different base types)"

---
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +0 -0
index 1662c03c..fdd9cf1 100644

drivers/staging/rtl8723au/hal/rtl8723a_cmd.c exit: · line 120

Quoted 7 lines
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +1 -1
@@ -115,7 +115,7 @@ exit:
 
 int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)
 {
-	*((u32 *)param) = cpu_to_le32(*((u32 *)param));
+	*((__le32 *)param) = cpu_to_le32(*((u32 *)param));
 
 	FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param);

*Cough*

Writing a 32 bit value to a pointer to a u8 is ugly in the first place. Rather than just wrapping it in yet another ugly typecast, please fix this properly.

Jes