Skip to contentSkip to conversation

rtlwifi: Fix reusable codes in core.c

PATCH Superseded Byeoungwook Kim 3 participants 6 messages Feb 3, 2016 – Apr 16, 2016

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 rtlwifi: Fix reusable codes in core.c

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

---
 drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)
drivers/net/wireless/realtek/rtlwifi/core.c +4 -24
index 05f432c..c1193d1 100644
@@ -63,18 +63,8 @@ EXPORT_SYMBOL(rtl_addr_delay);
 void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
 		     u32 mask, u32 data)
 {
-	if (addr == 0xfe) {
-		mdelay(50);
-	} else if (addr == 0xfd) {
-		mdelay(5);
-	} else if (addr == 0xfc) {
-		mdelay(1);
-	} else if (addr == 0xfb) {
-		udelay(50);
-	} else if (addr == 0xfa) {
-		udelay(5);
-	} else if (addr == 0xf9) {
-		udelay(1);
+	if (addr >= 0xf9 && addr <= 0xfe) {
+		rtl_addr_delay(addr);
 	} else {
 		rtl_set_rfreg(hw, rfpath, addr, mask, data);
 		udelay(1);
@@ -84,18 +74,8 @@ EXPORT_SYMBOL(rtl_rfreg_delay);
 
 void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
 {
-	if (addr == 0xfe) {
-		mdelay(50);
-	} else if (addr == 0xfd) {
-		mdelay(5);
-	} else if (addr == 0xfc) {
-		mdelay(1);
-	} else if (addr == 0xfb) {
-		udelay(50);
-	} else if (addr == 0xfa) {
-		udelay(5);
-	} else if (addr == 0xf9) {
-		udelay(1);
+	if (addr >= 0xf9 && addr <= 0xfe) {
+		rtl_addr_delay(addr);
 	} else {
 		rtl_set_bbreg(hw, addr, MASKDWORD, data);
 		udelay(1);
Signature · 1 line
2.5.0
Reviewed-by on v1 2/2
#1 lore raw

Hi Byeoungwook,

Quoted 5 lines · Byeoungwook Kim

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

Just a note for the future, you have to explicitly be given a reviewed-by, you can't just assume that someone who has made comments on a patch has reviewed it.

In this case, I have reviewed it, so formally:

Thanks,

Julian Calaby

Quoted 53 lines
---
 drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)
drivers/net/wireless/realtek/rtlwifi/core.c +4 -25
index 05f432c..c1193d1 100644
@@ -63,18 +63,8 @@ EXPORT_SYMBOL(rtl_addr_delay);
 void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
                     u32 mask, u32 data)
 {
-       if (addr == 0xfe) {
-               mdelay(50);
-       } else if (addr == 0xfd) {
-               mdelay(5);
-       } else if (addr == 0xfc) {
-               mdelay(1);
-       } else if (addr == 0xfb) {
-               udelay(50);
-       } else if (addr == 0xfa) {
-               udelay(5);
-       } else if (addr == 0xf9) {
-               udelay(1);
+       if (addr >= 0xf9 && addr <= 0xfe) {
+               rtl_addr_delay(addr);
        } else {
                rtl_set_rfreg(hw, rfpath, addr, mask, data);
                udelay(1);
@@ -84,18 +74,8 @@ EXPORT_SYMBOL(rtl_rfreg_delay);
 
 void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
 {
-       if (addr == 0xfe) {
-               mdelay(50);
-       } else if (addr == 0xfd) {
-               mdelay(5);
-       } else if (addr == 0xfc) {
-               mdelay(1);
-       } else if (addr == 0xfb) {
-               udelay(50);
-       } else if (addr == 0xfa) {
-               udelay(5);
-       } else if (addr == 0xf9) {
-               udelay(1);
+       if (addr >= 0xf9 && addr <= 0xfe) {
+               rtl_addr_delay(addr);
        } else {
                rtl_set_bbreg(hw, addr, MASKDWORD, data);
                udelay(1);
--

2.5.0

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#2 lore raw

Hi Julian,

I sent to modify the patch again.
Thanks for your assists!

Regards,
Byeoungwook

2016-02-03 11:06 GMT+09:00 Julian Calaby <[email protected]>:

Quoted 83 lines

Hi Byeoungwook,

Quoted 5 lines · Byeoungwook Kim

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

Just a note for the future, you have to explicitly be given a reviewed-by, you can't just assume that someone who has made comments on a patch has reviewed it.

In this case, I have reviewed it, so formally:

Thanks,

Julian Calaby

Quoted 51 lines
---
 drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)
drivers/net/wireless/realtek/rtlwifi/core.c +4 -25
index 05f432c..c1193d1 100644
@@ -63,18 +63,8 @@ EXPORT_SYMBOL(rtl_addr_delay);
 void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
                     u32 mask, u32 data)
 {
-       if (addr == 0xfe) {
-               mdelay(50);
-       } else if (addr == 0xfd) {
-               mdelay(5);
-       } else if (addr == 0xfc) {
-               mdelay(1);
-       } else if (addr == 0xfb) {
-               udelay(50);
-       } else if (addr == 0xfa) {
-               udelay(5);
-       } else if (addr == 0xf9) {
-               udelay(1);
+       if (addr >= 0xf9 && addr <= 0xfe) {
+               rtl_addr_delay(addr);
        } else {
                rtl_set_rfreg(hw, rfpath, addr, mask, data);
                udelay(1);
@@ -84,18 +74,8 @@ EXPORT_SYMBOL(rtl_rfreg_delay);
 
 void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
 {
-       if (addr == 0xfe) {
-               mdelay(50);
-       } else if (addr == 0xfd) {
-               mdelay(5);
-       } else if (addr == 0xfc) {
-               mdelay(1);
-       } else if (addr == 0xfb) {
-               udelay(50);
-       } else if (addr == 0xfa) {
-               udelay(5);
-       } else if (addr == 0xf9) {
-               udelay(1);
+       if (addr >= 0xf9 && addr <= 0xfe) {
+               rtl_addr_delay(addr);
        } else {
                rtl_set_bbreg(hw, addr, MASKDWORD, data);
                udelay(1);
--
Quoted 2 lines

2.5.0

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

#3 lore raw
In reply to Byeoungwook Kim
Quoted 5 lines · Byeoungwook Kim

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

Doesn't apply:

Applying: rtlwifi: Fix reusable codes in core.c
fatal: sha1 information is lacking or useless (drivers/net/wireless/realtek/rtlwifi/core.c). Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 rtlwifi: Fix reusable codes in core.c

Please rebase and resend.

Signature · 1 line
Kalle Valo
#4 lore raw

Hi Kalle,

Quoted 10 lines · Kalle Valo
Quoted 5 lines · Byeoungwook Kim

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

Doesn't apply:

Quoted 7 lines

Applying: rtlwifi: Fix reusable codes in core.c
fatal: sha1 information is lacking or useless (drivers/net/wireless/realtek/rtlwifi/core.c). Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 rtlwifi: Fix reusable codes in core.c

Please rebase and resend.

This one is already applied in some form. I thought I'd listed it in my big list of superseded patches, however I must have missed it.

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#5 lore raw
Quoted 19 lines · Julian Calaby

Hi Kalle,

Quoted 16 lines · Kalle Valo
Quoted 5 lines · Byeoungwook Kim

rtl_*_delay() functions were reused same codes about addr variable. So i have converted to rtl_addr_delay() from code about addr variable.

Doesn't apply:

Applying: rtlwifi: Fix reusable codes in core.c
fatal: sha1 information is lacking or useless (drivers/net/wireless/realtek/rtlwifi/core.c). Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 rtlwifi: Fix reusable codes in core.c

Quoted 4 lines
Quoted 1 line

Please rebase and resend.

This one is already applied in some form. I thought I'd listed it in my big list of superseded patches, however I must have missed it.

Or I missed it :) But good to know, so no actions needed anymore.

Signature · 1 line
Kalle Valo