Re: [PATCH] rtlwifi/*/dm.c: Use const in swing_table declarations

From: Pkshih
Date: Sun Jun 28 2020 - 22:09:53 EST


On Sun, 2020-06-28 at 03:17 -0700, Joe Perches wrote:

Use 'rtlwifi:' as subject title prefix is enough, likes
 rtlwifi: Use const in swing_table declarations

> Reduce data usage about 1KB by using const.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
> Â.../net/wireless/realtek/rtlwifi/rtl8188ee/dm.cÂÂÂÂ|ÂÂ4 +-
> Â.../net/wireless/realtek/rtlwifi/rtl8723be/dm.cÂÂÂÂ|ÂÂ4 +-
> Â.../net/wireless/realtek/rtlwifi/rtl8821ae/dm.cÂÂÂÂ| 98 ++++++++++++---------
> -
> Â3 files changed, 56 insertions(+), 50 deletions(-)
>
>
[...]
>Â
> Â
> Âstatic void rtl8812ae_get_delta_swing_table(struct ieee80211_hw *hw,
> - ÂÂÂÂu8 **up_a, u8 **down_a,
> - ÂÂÂÂu8 **up_b, u8 **down_b)
> + ÂÂÂÂconst u8 **up_a,
> + ÂÂÂÂconst u8 **down_a,
> + ÂÂÂÂconst u8 **up_b,
> + ÂÂÂÂconst u8 **down_b)
> Â{
> Â struct rtl_priv *rtlpriv = rtl_priv(hw);
> Â struct rtl_phy *rtlphy = &rtlpriv->phy;
>

Please remove below type casting:Â

@@ -1872,10 +1872,10 @@ static void rtl8821ae_get_delta_swing_table(struct
ieee80211_hw *hw,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*up_b = rtl8821ae_delta_swing_table_idx_5gb_p[2];
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*down_b = rtl8821ae_delta_swing_table_idx_5gb_n[2];
ÂÂÂÂÂÂÂÂ} else {
-ÂÂÂÂÂÂÂÂÂÂÂ*up_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p;
-ÂÂÂÂÂÂÂÂÂÂÂ*down_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n;
-ÂÂÂÂÂÂÂÂÂÂÂ*up_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p;
-ÂÂÂÂÂÂÂÂÂÂÂ*down_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*up_a = rtl8818e_delta_swing_table_idx_24gb_p;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*down_a = rtl8818e_delta_swing_table_idx_24gb_n;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*up_b = rtl8818e_delta_swing_table_idx_24gb_p;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*down_b = rtl8818e_delta_swing_table_idx_24gb_n;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂreturn;
Â}


[...]