diff mbox

[2/2] rtlwifi: Fix reusable codes in core.c

Message ID 20160203020139.GA13619@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Byeoungwook Kim Feb. 3, 2016, 2:01 a.m. UTC
rtl_*_delay() functions were reused same codes about addr variable.
So i have converted to rtl_addr_delay() from code about addr variable.

Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

Comments

Julian Calaby Feb. 3, 2016, 2:06 a.m. UTC | #1
Hi Byeoungwook,

On Wed, Feb 3, 2016 at 1:01 PM, Byeoungwook Kim <quddnr145@gmail.com> wrote:
> rtl_*_delay() functions were reused same codes about addr variable.
> So i have converted to rtl_addr_delay() from code about addr variable.
>
> Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

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:

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

Thanks,

Julian Calaby


> ---
>  drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
>  1 file changed, 4 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
> index 05f432c..c1193d1 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -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
>
Byeoungwook Kim Feb. 3, 2016, 2:31 a.m. UTC | #2
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 <julian.calaby@gmail.com>:
> Hi Byeoungwook,
>
> On Wed, Feb 3, 2016 at 1:01 PM, Byeoungwook Kim <quddnr145@gmail.com> wrote:
>> rtl_*_delay() functions were reused same codes about addr variable.
>> So i have converted to rtl_addr_delay() from code about addr variable.
>>
>> Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
>> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
>
> 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:
>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
>
> Thanks,
>
> Julian Calaby
>
>
>> ---
>>  drivers/net/wireless/realtek/rtlwifi/core.c | 28 ++++------------------------
>>  1 file changed, 4 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
>> index 05f432c..c1193d1 100644
>> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
>> @@ -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
>>
>
>
>
> --
> Julian Calaby
>
> Email: julian.calaby@gmail.com
> Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo April 15, 2016, 6:25 p.m. UTC | #3
Byeoungwook Kim <quddnr145@gmail.com> writes:

> rtl_*_delay() functions were reused same codes about addr variable.
> So i have converted to rtl_addr_delay() from code about addr variable.
>
> Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

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.
Julian Calaby April 16, 2016, 2:39 a.m. UTC | #4
Hi Kalle,

On Sat, Apr 16, 2016 at 4:25 AM, Kalle Valo <kvalo@codeaurora.org> wrote:
> Byeoungwook Kim <quddnr145@gmail.com> writes:
>
>> rtl_*_delay() functions were reused same codes about addr variable.
>> So i have converted to rtl_addr_delay() from code about addr variable.
>>
>> Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
>> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
>
> 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.

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,
Kalle Valo April 16, 2016, 4:31 a.m. UTC | #5
Julian Calaby <julian.calaby@gmail.com> writes:

> Hi Kalle,
>
> On Sat, Apr 16, 2016 at 4:25 AM, Kalle Valo <kvalo@codeaurora.org> wrote:
>> Byeoungwook Kim <quddnr145@gmail.com> writes:
>>
>>> rtl_*_delay() functions were reused same codes about addr variable.
>>> So i have converted to rtl_addr_delay() from code about addr variable.
>>>
>>> Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
>>> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
>>
>> 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.
>
> 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.
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 05f432c..c1193d1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -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);