From: Joe Perches <joe@perches.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Ping-Ke Shih <pkshih@realtek.com>,
Kalle Valo <kvalo@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtlwifi: remove duplicate code
Date: Thu, 24 May 2018 12:24:26 -0700 [thread overview]
Message-ID: <57f2881d031de041a6ce95cf8adc5ce80551ce19.camel@perches.com> (raw)
In-Reply-To: <20180524185450.GA2875@embeddedor.com>
On Thu, 2018-05-24 at 13:54 -0500, Gustavo A. R. Silva wrote:
> Remove and refactor some code in order to avoid having identical code
> for different branches.
True and nice tool and patch submittal thanks.
> Notice that the logic has been there since 2014.
But perhaps the original logic is a defective copy/paste
and it should be corrected instead.
Can anyone from realtek verify this?
> Addresses-Coverity-ID: 1426199 ("Identical code for different branches")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 23 ++++------------------
> 1 file changed, 4 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
> index 279fe01..df3facc 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
> @@ -2876,25 +2876,10 @@ static void btc8723b2ant_action_hid(struct btc_coexist *btcoexist)
> btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 13);
>
> /* sw mechanism */
> - if (BTC_WIFI_BW_HT40 == wifi_bw) {
> - if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
> - (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
> - btc8723b2ant_sw_mechanism(btcoexist, true, true,
> - false, false);
> - } else {
> - btc8723b2ant_sw_mechanism(btcoexist, true, true,
> - false, false);
> - }
> - } else {
> - if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
> - (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
> - btc8723b2ant_sw_mechanism(btcoexist, false, true,
> - false, false);
> - } else {
> - btc8723b2ant_sw_mechanism(btcoexist, false, true,
> - false, false);
> - }
> - }
> + if (wifi_bw == BTC_WIFI_BW_HT40)
> + btc8723b2ant_sw_mechanism(btcoexist, true, true, false, false);
> + else
> + btc8723b2ant_sw_mechanism(btcoexist, false, true, false, false);
> }
>
> /* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */
next prev parent reply other threads:[~2018-05-24 19:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 18:54 Gustavo A. R. Silva
2018-05-24 19:24 ` Joe Perches [this message]
2018-05-24 19:47 ` Gustavo A. R. Silva
2018-05-29 7:28 ` Kalle Valo
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=57f2881d031de041a6ce95cf8adc5ce80551ce19.camel@perches.com \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=gustavo@embeddedor.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pkshih@realtek.com \
/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®