mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kbuild-all@01.org
Subject: Re: drivers/staging/rtlwifi/base.c:920:7-9: WARNING: possible condition with no effect (if == else)
Date: Fri, 13 Oct 2017 15:55:39 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1710131553530.3242@hadrien> (raw)
In-Reply-To: <201710132012.kptCgENA%fengguang.wu@intel.com>

It seems that the then and else branches of the conditions on lines 920
and 932 are the same.

julia

On Fri, 13 Oct 2017, kbuild test robot wrote:

> CC: kbuild-all@01.org
> CC: linux-kernel@vger.kernel.org
> TO: Larry Finger <Larry.Finger@lwfinger.net>
> CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3d7882769b5dc929690f96e0c318c29b97f51018
> commit: 5b5ab4cb5cda824ef59e0511ac5d585f35f1a1a6 staging: r8822be: Add Makefiles and Kconfig for new driver
> date:   8 weeks ago
> :::::: branch date: 12 hours ago
> :::::: commit date: 8 weeks ago
>
> >> drivers/staging/rtlwifi/base.c:920:7-9: WARNING: possible condition with no effect (if == else)
>    drivers/staging/rtlwifi/base.c:932:7-9: WARNING: possible condition with no effect (if == else)
>
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5b5ab4cb5cda824ef59e0511ac5d585f35f1a1a6
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git remote update linus
> git checkout 5b5ab4cb5cda824ef59e0511ac5d585f35f1a1a6
> vim +920 drivers/staging/rtlwifi/base.c
>
> 56bde846 Ping-Ke Shih 2017-08-17  905
> 56bde846 Ping-Ke Shih 2017-08-17  906  static u8 _rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw,
> 56bde846 Ping-Ke Shih 2017-08-17  907  				      struct ieee80211_sta *sta)
> 56bde846 Ping-Ke Shih 2017-08-17  908  {
> 56bde846 Ping-Ke Shih 2017-08-17  909  	struct rtl_priv *rtlpriv = rtl_priv(hw);
> 56bde846 Ping-Ke Shih 2017-08-17  910  	struct rtl_phy *rtlphy = &rtlpriv->phy;
> 56bde846 Ping-Ke Shih 2017-08-17  911  	u8 hw_rate;
> 56bde846 Ping-Ke Shih 2017-08-17  912  	u16 tx_mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.tx_mcs_map);
> 56bde846 Ping-Ke Shih 2017-08-17  913
> 56bde846 Ping-Ke Shih 2017-08-17  914  	if ((get_rf_type(rtlphy) == RF_2T2R) &&
> 56bde846 Ping-Ke Shih 2017-08-17  915  	    (tx_mcs_map & 0x000c) != 0x000c) {
> 56bde846 Ping-Ke Shih 2017-08-17  916  		if ((tx_mcs_map & 0x000c) >> 2 ==
> 56bde846 Ping-Ke Shih 2017-08-17  917  			IEEE80211_VHT_MCS_SUPPORT_0_7)
> 56bde846 Ping-Ke Shih 2017-08-17  918  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  919  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_2SS_MCS7];
> 56bde846 Ping-Ke Shih 2017-08-17 @920  		else if ((tx_mcs_map  & 0x000c) >> 2 ==
> 56bde846 Ping-Ke Shih 2017-08-17  921  			IEEE80211_VHT_MCS_SUPPORT_0_8)
> 56bde846 Ping-Ke Shih 2017-08-17  922  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  923  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_2SS_MCS9];
> 56bde846 Ping-Ke Shih 2017-08-17  924  		else
> 56bde846 Ping-Ke Shih 2017-08-17  925  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  926  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_2SS_MCS9];
> 56bde846 Ping-Ke Shih 2017-08-17  927  	} else {
> 56bde846 Ping-Ke Shih 2017-08-17  928  		if ((tx_mcs_map  & 0x0003) ==
> 56bde846 Ping-Ke Shih 2017-08-17  929  			IEEE80211_VHT_MCS_SUPPORT_0_7)
> 56bde846 Ping-Ke Shih 2017-08-17  930  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  931  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_1SS_MCS7];
> 56bde846 Ping-Ke Shih 2017-08-17  932  		else if ((tx_mcs_map  & 0x0003) ==
> 56bde846 Ping-Ke Shih 2017-08-17  933  			IEEE80211_VHT_MCS_SUPPORT_0_8)
> 56bde846 Ping-Ke Shih 2017-08-17  934  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  935  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_1SS_MCS9];
> 56bde846 Ping-Ke Shih 2017-08-17  936  		else
> 56bde846 Ping-Ke Shih 2017-08-17  937  			hw_rate =
> 56bde846 Ping-Ke Shih 2017-08-17  938  			rtlpriv->cfg->maps[RTL_RC_VHT_RATE_1SS_MCS9];
> 56bde846 Ping-Ke Shih 2017-08-17  939  	}
> 56bde846 Ping-Ke Shih 2017-08-17  940
> 56bde846 Ping-Ke Shih 2017-08-17  941  	return hw_rate;
> 56bde846 Ping-Ke Shih 2017-08-17  942  }
> 56bde846 Ping-Ke Shih 2017-08-17  943
>
> :::::: The code at line 920 was first introduced by commit
> :::::: 56bde846304ea05d5f8c8de0e3a42627a7a92be6 staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver
>
> :::::: TO: Ping-Ke Shih <pkshih@realtek.com>
> :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>

       reply	other threads:[~2017-10-13 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201710132012.kptCgENA%fengguang.wu@intel.com>
2017-10-13 13:55 ` Julia Lawall [this message]
2017-10-13 18:11   ` Larry Finger
2017-10-13 21:48     ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1710131553530.3242@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®