diff mbox

rtlwifi: Remove unnecessary conditions

Message ID 20170622111655.GA4891@symbol-HP-ZBook-15 (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Souptick Joarder June 22, 2017, 11:16 a.m. UTC
As wmm_enable is initialized to false, hence the else condition never
execute and boundary is assigned with TX_PAGE_BOUNDARY. So the if-else
condition can be removed and boundary will be assigned with TX_PAGE_BOUNDARY.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 6 ------
 1 file changed, 6 deletions(-)

--
1.9.1

Comments

Julian Calaby June 22, 2017, 12:33 p.m. UTC | #1
Hi Souptick,

On Thu, Jun 22, 2017 at 9:16 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> As wmm_enable is initialized to false, hence the else condition never
> execute and boundary is assigned with TX_PAGE_BOUNDARY. So the if-else
> condition can be removed and boundary will be assigned with TX_PAGE_BOUNDARY.
>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> index f95a645..e9c5f6a 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
> @@ -845,13 +845,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
>                 pr_err("Failed to init power on!\n");
>                 return err;
>         }
> -       if (!wmm_enable) {
>                 boundary = TX_PAGE_BOUNDARY;

Firstly this isn't indented properly.

Secondly, can this be moved up to where boundary is defined?

Thanks,
Souptick Joarder June 22, 2017, 12:40 p.m. UTC | #2
Hi Julian,

On Thu, Jun 22, 2017 at 6:03 PM, Julian Calaby <julian.calaby@gmail.com> wrote:
> Hi Souptick,
>
> On Thu, Jun 22, 2017 at 9:16 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> As wmm_enable is initialized to false, hence the else condition never
>> execute and boundary is assigned with TX_PAGE_BOUNDARY. So the if-else
>> condition can be removed and boundary will be assigned with TX_PAGE_BOUNDARY.
>>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
>> index f95a645..e9c5f6a 100644
>> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
>> @@ -845,13 +845,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
>>                 pr_err("Failed to init power on!\n");
>>                 return err;
>>         }
>> -       if (!wmm_enable) {
>>                 boundary = TX_PAGE_BOUNDARY;
>
> Firstly this isn't indented properly.
>
> Secondly, can this be moved up to where boundary is defined?

Sure. I will modify it and send in v2.

>
> Thanks,
>
> --
> Julian Calaby
>
> Email: julian.calaby@gmail.com
> Profile: http://www.google.com/profiles/julian.calaby/

-Souptick
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index f95a645..e9c5f6a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -845,13 +845,7 @@  static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
 		pr_err("Failed to init power on!\n");
 		return err;
 	}
-	if (!wmm_enable) {
 		boundary = TX_PAGE_BOUNDARY;
-	} else { /* for WMM */
-		boundary = (IS_NORMAL_CHIP(rtlhal->version))
-					? WMM_CHIP_B_TX_PAGE_BOUNDARY
-					: WMM_CHIP_A_TX_PAGE_BOUNDARY;
-	}
 	if (false == rtl92c_init_llt_table(hw, boundary)) {
 		pr_err("Failed to init LLT Table!\n");
 		return -EINVAL;