Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Ching-Te Ku <ku920601@realtek.com>
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] wifi: rtw89: coex: Add Bluetooth binding for Bluetooth RX gain setting
Date: Wed, 19 Aug 2026 20:44:35 +0300	[thread overview]
Message-ID: <aoXrgwyFu851qVNV@stanley.mountain> (raw)

Hello Ching-Te Ku,

Commit fe8f6ddb9095 ("wifi: rtw89: coex: Add Bluetooth binding for
Bluetooth RX gain setting") from Jul 6, 2026 (linux-next), leads to
the following Smatch static checker warning:

	drivers/net/wireless/realtek/rtw89/coex.c:3943 _set_bt_rx_gain()
	warn: duplicate check 'rf_band' (previous on line 3927)

drivers/net/wireless/realtek/rtw89/coex.c
    3914 static void _set_bt_rx_gain(struct rtw89_dev *rtwdev, bool force_exec, u8 bid,
    3915                             u8 rf_band, u8 level)
    3916 {
    3917         struct rtw89_btc *btc = &rtwdev->btc;
    3918         struct rtw89_btc_cx *cx = &btc->cx;
    3919         struct rtw89_btc_bt_info *bt = &cx->bt0;
    3920         u8 h2c_func = SET_BT_LNA_CONSTRAIN;
    3921         u8 i, id_start, id_stop;
    3922         bool state = false;
    3923         u32 scbd_bit = 0;
    3924         u8 buf[2] = {};
    3925         u8 len = sizeof(*buf);
    3926 
    3927         if (bt->bcnt[BTC_BCNT_INFOUPDATE] == 0 || !rf_band)
                                                            ^^^^^^^
The patch adds a check here

    3928                 return;
    3929 
    3930         if (bt->rf_para.rx_gain_freerun == level ||
    3931             level > BTC_BT_RX_NORMAL_LVL || !rtwdev->chip->scbd ||
    3932             bid > BTC_ALL_BT)
    3933                 return;
    3934 
    3935         if (bid == BTC_ALL_BT) {
    3936                 id_start = BTC_BT_1ST;
    3937                 id_stop = BTC_BT_2ND;
    3938         } else {
    3939                 id_start = bid;
    3940                 id_stop = bid;
    3941         }
    3942 
--> 3943         if (rf_band == RTW89_BAND_2G)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
RTW89_BAND_2G is zero so this is dead code.

    3944                 scbd_bit |= BTC_WSCB_RXGAIN;
    3945         else
    3946                 scbd_bit |= BTC_WSCB_RXGAIN_56G;
    3947 

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

             reply	other threads:[~2026-08-19 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 17:44 Dan Carpenter [this message]
2026-09-07  5:55 ` [bug report] wifi: rtw89: coex: Add Bluetooth binding for Bluetooth RX gain setting Ping-Ke Shih

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=aoXrgwyFu851qVNV@stanley.mountain \
    --to=error27@gmail.com \
    --cc=ku920601@realtek.com \
    --cc=linux-wireless@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