> -----Original Message----- > From: Dmitry Antipov <dmantipov@xxxxxxxxx> > Sent: Wednesday, November 1, 2023 7:35 PM > To: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > Cc: Kalle Valo <kvalo@xxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx; lvc-project@xxxxxxxxxxxxxxxx; Dmitry > Antipov <dmantipov@xxxxxxxxx> > 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@xxxxxxxxx> > --- > .../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