From: Ping-Ke Shih <pkshih@realtek.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Kalle Valo <kvalo@kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>
Subject: RE: [PATCH 2/2] wifi: rtlwifi: simplify _rtl8812ae_phy_get_txpower_limit()
Date: Mon, 6 Nov 2023 03:44:50 +0000 [thread overview]
Message-ID: <1c93129fac184534901eca45b563cf44@realtek.com> (raw)
In-Reply-To: <20231101113510.51290-2-dmantipov@yandex.ru>
> -----Original Message-----
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Sent: Wednesday, November 1, 2023 7:35 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; lvc-project@linuxtesting.org; Dmitry
> Antipov <dmantipov@yandex.ru>
> Subject: [PATCH 2/2] wifi: rtlwifi: simplify _rtl8812ae_phy_get_txpower_limit()
>
> Since 'regulation' is a compile-time constant equal to
> 'TXPWR_LMT_WW', mark it as such and simplify few branches
> in '_rtl8812ae_phy_get_txpower_limit()'. Compile tested only.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
> .../wireless/realtek/rtlwifi/rtl8821ae/phy.c | 24 +++++++------------
> 1 file changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> index c262770fea29..27e256a82f00 100644
[...]
> @@ -2415,10 +2413,7 @@ static s8 _rtl8812ae_phy_get_txpower_limit(struct ieee80211_hw *hw,
> limits[i] = rtlphy->txpwr_limit_2_4g[i][bdwidth]
> [sec][chnl][rf_path];
>
> - power_limit = (regulation == TXPWR_LMT_WW) ?
> - _rtl8812ae_phy_get_world_wide_limit(limits) :
> - rtlphy->txpwr_limit_2_4g[regu][bdwidth]
> - [sec][chnl][rf_path];
> + power_limit = _rtl8812ae_phy_get_world_wide_limit(limits);
I think the constantly selection of "WW" is just a workaround, and correct
way is to add regd notifier and handle regulatory request.
Ping-Ke
next prev parent reply other threads:[~2023-11-06 3:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 11:35 [PATCH 1/2] wifi: rtlwifi: remove dead code in phy_get_tx_swing_8812A() Dmitry Antipov
2023-11-01 11:35 ` [PATCH 2/2] wifi: rtlwifi: simplify _rtl8812ae_phy_get_txpower_limit() Dmitry Antipov
2023-11-06 3:44 ` Ping-Ke Shih [this message]
2023-11-06 3:37 ` [PATCH 1/2] wifi: rtlwifi: remove dead code in phy_get_tx_swing_8812A() 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=1c93129fac184534901eca45b563cf44@realtek.com \
--to=pkshih@realtek.com \
--cc=dmantipov@yandex.ru \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lvc-project@linuxtesting.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;
as well as URLs for NNTP newsgroup(s).