Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452806 > unrolled thread

[PATCH 1/1] rtlwifi: remove superfluous condition

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-07-31 12:40 +0200
Last post2016-08-03 12:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] rtlwifi: remove superfluous condition Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-07-31 12:40 +0200
    Re: [PATCH 1/1] rtlwifi: remove superfluous condition Larry Finger <Larry.Finger@lwfinger.net> - 2016-07-31 16:20 +0200
      [PATCH 1/1 v2] rtlwifi: remove superfluous condition Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-08-02 21:30 +0200
        Re: [PATCH 1/1 v2] rtlwifi: remove superfluous condition Kalle Valo <kvalo@codeaurora.org> - 2016-08-03 12:30 +0200

#1452806 — [PATCH 1/1] rtlwifi: remove superfluous condition

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-07-31 12:40 +0200
Subject[PATCH 1/1] rtlwifi: remove superfluous condition
Message-ID<s0Wk1-7kp-1@gated-at.bofh.it>
If sta == NULL, the changed line will not be reached.
So no need to check if stat == NULL here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 41f77f8..7aee5ebb1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1135,7 +1135,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
 					mac->mode = WIRELESS_MODE_AC_24G;
 			}
 
-			if (vif->type == NL80211_IFTYPE_STATION && sta)
+			if (vif->type == NL80211_IFTYPE_STATION)
 				rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
 			rcu_read_unlock();
 
-- 
2.8.1

[toc] | [next] | [standalone]


#1452832

FromLarry Finger <Larry.Finger@lwfinger.net>
Date2016-07-31 16:20 +0200
Message-ID<s0ZKV-1cv-7@gated-at.bofh.it>
In reply to#1452806
On 07/31/2016 05:30 AM, Heinrich Schuchardt wrote:
> If sta == NULL, the changed line will not be reached.
> So no need to check if stat == NULL here.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I agree. If sta were NULL, we would never have reached this statement. There is, 
however, a typo in the last line of the commit message. Once this is fixed, you 
may add the line "Acked-by: Larry Finger <Larry.Finger@lwfinger.net>"

Thanks,

Larry

>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
> index 41f77f8..7aee5ebb1 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -1135,7 +1135,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
>  					mac->mode = WIRELESS_MODE_AC_24G;
>  			}
>
> -			if (vif->type == NL80211_IFTYPE_STATION && sta)
> +			if (vif->type == NL80211_IFTYPE_STATION)
>  				rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
>  			rcu_read_unlock();
>
>

[toc] | [prev] | [next] | [standalone]


#1455425 — [PATCH 1/1 v2] rtlwifi: remove superfluous condition

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-08-02 21:30 +0200
Subject[PATCH 1/1 v2] rtlwifi: remove superfluous condition
Message-ID<s1Ny1-s4-13@gated-at.bofh.it>
In reply to#1452832
If sta == NULL, the changed line will not be reached.
So no need to check that sta != NULL here.

v2:
	fix typo

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 41f77f8..7aee5ebb1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1135,7 +1135,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
 					mac->mode = WIRELESS_MODE_AC_24G;
 			}
 
-			if (vif->type == NL80211_IFTYPE_STATION && sta)
+			if (vif->type == NL80211_IFTYPE_STATION)
 				rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
 			rcu_read_unlock();
 
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1455733 — Re: [PATCH 1/1 v2] rtlwifi: remove superfluous condition

FromKalle Valo <kvalo@codeaurora.org>
Date2016-08-03 12:30 +0200
SubjectRe: [PATCH 1/1 v2] rtlwifi: remove superfluous condition
Message-ID<s21B0-1hs-9@gated-at.bofh.it>
In reply to#1455425
Heinrich Schuchardt <xypron.glpk@gmx.de> writes:

> If sta == NULL, the changed line will not be reached.
> So no need to check that sta != NULL here.
>
> v2:
> 	fix typo
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>  drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The change log goes under the "---" line so that git can automatically
strip it away while committing the patch. I can fix it this time but
please keep this in mind in the future.

-- 
Kalle Valo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web