Search Linux Wireless

Re: [PATCH] rtlwifi: use correct argument order for memset in efuse.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/18/2011 10:52 AM, John W. Linville wrote:
Reported-by: Al Viro<viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: John W. Linville<linville@xxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxx
---
  drivers/net/wireless/rtlwifi/efuse.c |   14 +++++++-------
  1 files changed, 7 insertions(+), 7 deletions(-)

ACK. My only question is whether http://marc.info/?l=linux-wireless&m=130038716529880&w=3 has precedence. Unfortunately, it went only to linux-wireless and not to Linville.

Let me know which one you plan to use.

Larry


diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 4f92cba..ef91905 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -479,8 +479,8 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw)
  	struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));

  	if (rtlefuse->autoload_failflag == true) {
-		memset((void *)(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0]), 128,
-		       0xFF);
+		memset((void *)(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0]), 0xFF,
+		       128);
  	} else
  		efuse_read_all_map(hw,&rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);

@@ -694,8 +694,8 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
  	if (offset>  15)
  		return false;

-	memset((void *)data, PGPKT_DATA_SIZE * sizeof(u8), 0xff);
-	memset((void *)tmpdata, PGPKT_DATA_SIZE * sizeof(u8), 0xff);
+	memset((void *)data, 0xff, PGPKT_DATA_SIZE * sizeof(u8));
+	memset((void *)tmpdata, 0xff, PGPKT_DATA_SIZE * sizeof(u8));

  	while (bcontinual&&  (efuse_addr<  EFUSE_MAX_SIZE)) {
  		if (readstate&  PG_STATE_HEADER) {
@@ -862,7 +862,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);

-		memset((void *)originaldata, 8 * sizeof(u8), 0xff);
+		memset((void *)originaldata, 0xff, 8 * sizeof(u8));

  		if (efuse_pg_packet_read(hw, tmp_pkt.offset, originaldata)) {
  			badworden = efuse_word_enable_data_write(hw,
@@ -917,7 +917,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
  	target_pkt.offset = offset;
  	target_pkt.word_en = word_en;

-	memset((void *)target_pkt.data, 8 * sizeof(u8), 0xFF);
+	memset((void *)target_pkt.data, 0xFF, 8 * sizeof(u8));

  	efuse_word_enable_data_read(word_en, data, target_pkt.data);
  	target_word_cnts = efuse_calculate_word_cnts(target_pkt.word_en);
@@ -1022,7 +1022,7 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw,
  	u8 badworden = 0x0F;
  	u8 tmpdata[8];

-	memset((void *)tmpdata, PGPKT_DATA_SIZE, 0xff);
+	memset((void *)tmpdata, 0xff, PGPKT_DATA_SIZE);
  	RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
  		 ("word_en = %x efuse_addr=%x\n", word_en, efuse_addr));


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux