Search Linux Wireless

Re: [PATCH] rtlwifi: rtl8188ee: mark RTX_POWER_{BEFORE,AFTER}_IQK_A reads as unused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2023-06-01 at 13:52 +0300, Dmitry Antipov wrote:
> 
> According to Ping-Ke Shih, it may be unsafe to remove BB register reads
> even if we don't interested in their values. OTOH such a reads may confuse
> compilers (when the most strictness warning options are enabled) and/or
> static analysis tools. So it may be helpful to convert related calls of
> 'rtl_get_bbreg()' to 'void' and mark such a cases with special comment
> just to make them easier to find and maybe even fix in the future.
> 
> This is generally inspired by 6c75eab0417b9e5b05a18dbfc373e27a8ef876d8.

Normally, mention a commit by `commit <12 digits SHA1> ("subject")`

> 
> Suggested-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> index 12d0b3a87af7..856c626cc99b 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
> @@ -1475,8 +1475,8 @@ static u8 _rtl88e_phy_path_a_rx_iqk(struct ieee80211_hw *hw, bool
> config_pathb)
>         mdelay(IQK_DELAY_TIME);
> 
>         reg_eac = rtl_get_bbreg(hw, RRX_POWER_AFTER_IQK_A_2, MASKDWORD);
> -       reg_e94 = rtl_get_bbreg(hw, RTX_POWER_BEFORE_IQK_A, MASKDWORD);
> -       reg_e9c = rtl_get_bbreg(hw, RTX_POWER_AFTER_IQK_A, MASKDWORD);
> +       /* unused */ (void)rtl_get_bbreg(hw, RTX_POWER_BEFORE_IQK_A, MASKDWORD);
> +       /* unused */ (void)rtl_get_bbreg(hw, RTX_POWER_AFTER_IQK_A, MASKDWORD);

Why not just

rtl_get_bbreg(hw, RTX_POWER_BEFORE_IQK_A, MASKDWORD);
rtl_get_bbreg(hw, RTX_POWER_AFTER_IQK_A, MASKDWORD);


>         reg_ea4 = rtl_get_bbreg(hw, RRX_POWER_BEFORE_IQK_A_2, MASKDWORD);
> 
>         if (!(reg_eac & BIT(27)) &&
> --
> 2.40.1
> 




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux