All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pkshih <pkshih@realtek.com>
To: 莊彥宣 <yhchuang@realtek.com>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"gustavo@embeddedor.com" <gustavo@embeddedor.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [rtlwifi-btcoex] Suspicious code in halbtc8821a1ant driver
Date: Thu, 5 Apr 2018 02:06:56 +0000	[thread overview]
Message-ID: <1522894016.1824.2.camel@realtek.com> (raw)
In-Reply-To: <20180405012540.GA24241@embeddedor.com>

T24gVGh1LCAyMDE4LTA0LTA1IGF0IDAxOjI1ICswMDAwLCBHdXN0YXZvIEEuIFIuIFNpbHZhIHdy
b3RlOg0KPiBIaSBhbGwsDQo+IA0KPiBXaGlsZSBkb2luZyBzb21lIHN0YXRpYyBhbmFseXNpcyBJ
IGNhbWUgYWNyb3NzIHRoZSBmb2xsb3dpbmcgcGllY2Ugb2YgY29kZSBhdA0KPiBkcml2ZXJzL25l
dC93aXJlbGVzcy9yZWFsdGVrL3J0bHdpZmkvYnRjb2V4aXN0L2hhbGJ0Yzg4MjFhMWFudC5jOjE1
ODE6DQo+IA0KPiAxNTgxIHN0YXRpYyB2b2lkIGJ0Yzg4MjFhMWFudF9hY3RfYnRfc2NvX2hpZF9v
bmx5X2J1c3koc3RydWN0IGJ0Y19jb2V4aXN0ICpidGNvZXhpc3QsDQo+IDE1ODLCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqB1OCB3aWZpX3N0YXR1cykNCj4gMTU4
MyB7DQo+IDE1ODTCoMKgwqDCoMKgwqDCoMKgwqAvKiB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j4gDQoNCkl0IGxvb2tzIHdlaXJkLiBTaW5jZSB3ZSdyZSBpbiBzcHJpbmcgdmFj
YXRpb24sIEknbGwgY2hlY2sgbXkgY29sbGVhZ3VlIG5leHQgTW9uZGF5Lg0KDQpQSw0KDQo=

WARNING: multiple messages have this Message-ID (diff)
From: Pkshih <pkshih@realtek.com>
To: 莊彥宣 <yhchuang@realtek.com>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"gustavo@embeddedor.com" <gustavo@embeddedor.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [rtlwifi-btcoex] Suspicious code in halbtc8821a1ant driver
Date: Thu, 5 Apr 2018 02:06:56 +0000	[thread overview]
Message-ID: <1522894016.1824.2.camel@realtek.com> (raw)
In-Reply-To: <20180405012540.GA24241@embeddedor.com>

On Thu, 2018-04-05 at 01:25 +0000, Gustavo A. R. Silva wrote:
> Hi all,
> 
> While doing some static analysis I came across the following piece of code at
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1581:
> 
> 1581 static void btc8821a1ant_act_bt_sco_hid_only_busy(struct btc_coexist *btcoexist,
> 1582                                                   u8 wifi_status)
> 1583 {
> 1584         /* tdma and coex table */
> 1585         btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5);
> 1586 
> 1587         if (BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN ==
> 1588             wifi_status)
> 1589                 btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
> 1590         else
> 1591                 btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
> 1592 }
> 
> The issue here is that the code for both branches of the if-else statement is identical.
> 
> The if-else was introduced a year ago in this commit c6821613e653
> 
> I wonder if an argument should be changed in any of the calls to
> btc8821a1ant_coex_table_with_type?
> 
> 

It looks weird. Since we're in spring vacation, I'll check my colleague next Monday.

PK

  reply	other threads:[~2018-04-05  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  1:25 [rtlwifi-btcoex] Suspicious code in halbtc8821a1ant driver Gustavo A. R. Silva
2018-04-05  1:25 ` Gustavo A. R. Silva
2018-04-05  2:06 ` Pkshih [this message]
2018-04-05  2:06   ` Pkshih

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=1522894016.1824.2.camel@realtek.com \
    --to=pkshih@realtek.com \
    --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=yhchuang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.