Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723au: change parameter type in rtl8723a_set_rssi_cmd declaration

Previosly the function had the following prototype:
int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)

My suggestion here is to modify the prototype this way:
int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u32 param)

We can do this based on the following considerations:
1. rtl8723a_set_rssi_cmd is used only with 32-bit "param" values
2. There's no point in using "u8 *param" until we pass param length
3. As we just read "param", it's ok to pass it by value

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Anatoly Stepanov and committed by
Greg Kroah-Hartman
485b099a 3d7a8477

+5 -5
+1 -1
drivers/staging/rtl8723au/hal/odm.c
··· 1274 1274 1275 1275 for (i = 0; i < sta_cnt; i++) { 1276 1276 if (PWDB_rssi[i] != (0)) 1277 - rtl8723a_set_rssi_cmd(Adapter, (u8 *)&PWDB_rssi[i]); 1277 + rtl8723a_set_rssi_cmd(Adapter, PWDB_rssi[i]); 1278 1278 } 1279 1279 1280 1280 pdmpriv->EntryMaxUndecoratedSmoothedPWDB = MaxDB;
+3 -3
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
··· 113 113 return ret; 114 114 } 115 115 116 - int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param) 116 + int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u32 param) 117 117 { 118 - *((u32 *)param) = cpu_to_le32(*((u32 *)param)); 118 + __le32 cmd = cpu_to_le32(param); 119 119 120 - FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param); 120 + FillH2CCmd(padapter, RSSI_SETTING_EID, 3, (void *)&cmd); 121 121 122 122 return _SUCCESS; 123 123 }
+1 -1
drivers/staging/rtl8723au/include/rtl8723a_cmd.h
··· 149 149 #else 150 150 #define rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter) do {} while(0) 151 151 #endif 152 - int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param); 152 + int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u32 param); 153 153 int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg); 154 154 void rtl8723a_add_rateatid(struct rtw_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level); 155 155