Commit 6e9d592f authored by Ilia Mirkin's avatar Ilia Mirkin Committed by John W. Linville

rtlwifi: Fix memset argument order

These were found using the following semantic match:
// <smpl>
@@expression E1; type T;@@
* memset(E1, ... * sizeof(T) * ..., ...);
// </smpl>

Also take this opportunity to remove the unnecessary void* casts.
Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5da201a4
...@@ -410,8 +410,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw) ...@@ -410,8 +410,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
if (!efuse_shadow_update_chk(hw)) { if (!efuse_shadow_update_chk(hw)) {
efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
(void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
...@@ -446,9 +446,9 @@ bool efuse_shadow_update(struct ieee80211_hw *hw) ...@@ -446,9 +446,9 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
if (word_en != 0x0F) { if (word_en != 0x0F) {
u8 tmpdata[8]; u8 tmpdata[8];
memcpy((void *)tmpdata, memcpy(tmpdata,
(void *)(&rtlefuse-> &rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base],
efuse_map[EFUSE_MODIFY_MAP][base]), 8); 8);
RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD, RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD,
("U-efuse\n"), tmpdata, 8); ("U-efuse\n"), tmpdata, 8);
...@@ -465,8 +465,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw) ...@@ -465,8 +465,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
efuse_power_switch(hw, true, false); efuse_power_switch(hw, true, false);
efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
(void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("<---\n")); RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("<---\n"));
...@@ -479,13 +479,12 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw) ...@@ -479,13 +479,12 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw)
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
if (rtlefuse->autoload_failflag == true) { if (rtlefuse->autoload_failflag == true) {
memset((void *)(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0]), 128, memset(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 0xFF, 128);
0xFF);
} else } else
efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
(void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
} }
...@@ -694,8 +693,8 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) ...@@ -694,8 +693,8 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
if (offset > 15) if (offset > 15)
return false; return false;
memset((void *)data, PGPKT_DATA_SIZE * sizeof(u8), 0xff); memset(data, 0xff, PGPKT_DATA_SIZE * sizeof(u8));
memset((void *)tmpdata, PGPKT_DATA_SIZE * sizeof(u8), 0xff); memset(tmpdata, 0xff, PGPKT_DATA_SIZE * sizeof(u8));
while (bcontinual && (efuse_addr < EFUSE_MAX_SIZE)) { while (bcontinual && (efuse_addr < EFUSE_MAX_SIZE)) {
if (readstate & PG_STATE_HEADER) { if (readstate & PG_STATE_HEADER) {
...@@ -862,7 +861,7 @@ static void efuse_write_data_case2(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -862,7 +861,7 @@ static void efuse_write_data_case2(struct ieee80211_hw *hw, u16 *efuse_addr,
tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en);
memset((void *)originaldata, 8 * sizeof(u8), 0xff); memset(originaldata, 0xff, 8 * sizeof(u8));
if (efuse_pg_packet_read(hw, tmp_pkt.offset, originaldata)) { if (efuse_pg_packet_read(hw, tmp_pkt.offset, originaldata)) {
badworden = efuse_word_enable_data_write(hw, badworden = efuse_word_enable_data_write(hw,
...@@ -917,7 +916,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw, ...@@ -917,7 +916,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
target_pkt.offset = offset; target_pkt.offset = offset;
target_pkt.word_en = word_en; target_pkt.word_en = word_en;
memset((void *)target_pkt.data, 8 * sizeof(u8), 0xFF); memset(target_pkt.data, 0xFF, 8 * sizeof(u8));
efuse_word_enable_data_read(word_en, data, target_pkt.data); efuse_word_enable_data_read(word_en, data, target_pkt.data);
target_word_cnts = efuse_calculate_word_cnts(target_pkt.word_en); target_word_cnts = efuse_calculate_word_cnts(target_pkt.word_en);
...@@ -1022,7 +1021,7 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw, ...@@ -1022,7 +1021,7 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw,
u8 badworden = 0x0F; u8 badworden = 0x0F;
u8 tmpdata[8]; u8 tmpdata[8];
memset((void *)tmpdata, PGPKT_DATA_SIZE, 0xff); memset(tmpdata, 0xff, PGPKT_DATA_SIZE);
RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
("word_en = %x efuse_addr=%x\n", word_en, efuse_addr)); ("word_en = %x efuse_addr=%x\n", word_en, efuse_addr));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment