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

From: Pkshih
Date: Sun Jun 28 2020 - 23:13:21 EST


On Sun, 2020-06-28 at 19:51 -0700, joe@xxxxxxxxxxx wrote:
> On 2020-06-28 19:09, Pkshih wrote:
> > 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
>
> We disagree.
>
> I like knowing what content is changed via patch subject lines
> as there are 3 rtlwifi drivers being changed by this one patch.

If 3 drivers are needed to be listed, I'd use below subject

"rtlwifi: Use const in rtl8188ee/rtl8723be/rtl8821ae swing_table declarations"

>
> But your choice, you can change it if you choose.
>
> >> Reduce data usage about 1KB by using const.
> []
> > 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;
>
> The compiler is quiet about this so I believe this to be
> an unrelated change and whitespace correction.

I know compiler doesn't warn this, but it looks wired to cast 'const u8 *'
to 'u8 *' to 'const u8 *'.


>
> Of course you could modify it if you choose.
>
> btw: There's an unnecessary return at the 2nd instance
> ÂÂÂÂÂÂof this cast removal too.

It seems like to copy fromÂrtl8812ae_get_delta_swing_table(), so
I can remove it by another patch.

>
> cheers, Joe
>
> ------Please consider the environment before printing this e-mail.