RE: [PATCH 21/22] rtw89: Replace comments with C99 initializers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "'Kalle Valo'" <kvalo@xxxxxxxxxx>, Larry Finger <Larry.Finger@xxxxxxxxxxxx>
- Subject: RE: [PATCH 21/22] rtw89: Replace comments with C99 initializers
- From: David Laight <David.Laight@xxxxxxxxxx>
- Date: Mon, 28 Mar 2022 12:21:04 +0000
- Accept-language: en-GB, en-US
- Cc: Benjamin Stürz <benni@xxxxxxxxxx>, "andrew@xxxxxxx" <andrew@xxxxxxx>, "sebastian.hesselbarth@xxxxxxxxx" <sebastian.hesselbarth@xxxxxxxxx>, "gregory.clement@xxxxxxxxxxx" <gregory.clement@xxxxxxxxxxx>, "linux@xxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxx>, "linux@xxxxxxxxxxxx" <linux@xxxxxxxxxxxx>, "krzk@xxxxxxxxxx" <krzk@xxxxxxxxxx>, "alim.akhtar@xxxxxxxxxxx" <alim.akhtar@xxxxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>, "mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "bp@xxxxxxxxx" <bp@xxxxxxxxx>, "dave.hansen@xxxxxxxxxxxxxxx" <dave.hansen@xxxxxxxxxxxxxxx>, "hpa@xxxxxxxxx" <hpa@xxxxxxxxx>, "robert.moore@xxxxxxxxx" <robert.moore@xxxxxxxxx>, "rafael.j.wysocki@xxxxxxxxx" <rafael.j.wysocki@xxxxxxxxx>, "lenb@xxxxxxxxxx" <lenb@xxxxxxxxxx>, "3chas3@xxxxxxxxx" <3chas3@xxxxxxxxx>, "laforge@xxxxxxxxxxxx" <laforge@xxxxxxxxxxxx>, "arnd@xxxxxxxx" <arnd@xxxxxxxx>, "gregkh@xxxxxxxxxxxxxxxxxxx" <gregkh@xxxxxxxxxxxxxxxxxxx>, "mchehab@xxxxxxxxxx" <mchehab@xxxxxxxxxx>, "tony.luck@xxxxxxxxx" <tony.luck@xxxxxxxxx>, "james.morse@xxxxxxx" <james.morse@xxxxxxx>, "rric@xxxxxxxxxx" <rric@xxxxxxxxxx>, "linus.walleij@xxxxxxxxxx" <linus.walleij@xxxxxxxxxx>, "brgl@xxxxxxxx" <brgl@xxxxxxxx>, "mike.marciniszyn@xxxxxxxxxxxxxxxxxxxx" <mike.marciniszyn@xxxxxxxxxxxxxxxxxxxx>, "dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx" <dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx>, "jgg@xxxxxxxx" <jgg@xxxxxxxx>, "pali@xxxxxxxxxx" <pali@xxxxxxxxxx>, "dmitry.torokhov@xxxxxxxxx" <dmitry.torokhov@xxxxxxxxx>, "isdn@xxxxxxxxxxxxxx" <isdn@xxxxxxxxxxxxxx>, "benh@xxxxxxxxxxxxxxxxxxx" <benh@xxxxxxxxxxxxxxxxxxx>, "fbarrat@xxxxxxxxxxxxx" <fbarrat@xxxxxxxxxxxxx>, "ajd@xxxxxxxxxxxxx" <ajd@xxxxxxxxxxxxx>, "davem@xxxxxxxxxxxxx" <davem@xxxxxxxxxxxxx>, "kuba@xxxxxxxxxx" <kuba@xxxxxxxxxx>, "pabeni@xxxxxxxxxx" <pabeni@xxxxxxxxxx>, "nico@xxxxxxxxxxx" <nico@xxxxxxxxxxx>, "loic.poulain@xxxxxxxxxx" <loic.poulain@xxxxxxxxxx>, "pkshih@xxxxxxxxxxx" <pkshih@xxxxxxxxxxx>, "bhelgaas@xxxxxxxxxx" <bhelgaas@xxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "linux-samsung-soc@xxxxxxxxxxxxxxx" <linux-samsung-soc@xxxxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, "linux-acpi@xxxxxxxxxxxxxxx" <linux-acpi@xxxxxxxxxxxxxxx>, "devel@xxxxxxxxxx" <devel@xxxxxxxxxx>, "linux-atm-general@xxxxxxxxxxxxxxxxxxxxx" <linux-atm-general@xxxxxxxxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxxxxxx" <netdev@xxxxxxxxxxxxxxx>, "linux-edac@xxxxxxxxxxxxxxx" <linux-edac@xxxxxxxxxxxxxxx>, "linux-gpio@xxxxxxxxxxxxxxx" <linux-gpio@xxxxxxxxxxxxxxx>, "linux-rdma@xxxxxxxxxxxxxxx" <linux-rdma@xxxxxxxxxxxxxxx>, "linux-input@xxxxxxxxxxxxxxx" <linux-input@xxxxxxxxxxxxxxx>, "linuxppc-dev@xxxxxxxxxxxxxxxx" <linuxppc-dev@xxxxxxxxxxxxxxxx>, "linux-media@xxxxxxxxxxxxxxx" <linux-media@xxxxxxxxxxxxxxx>, "wcn36xx@xxxxxxxxxxxxxxxxxxx" <wcn36xx@xxxxxxxxxxxxxxxxxxx>, "linux-wireless@xxxxxxxxxxxxxxx" <linux-wireless@xxxxxxxxxxxxxxx>, "linux-pci@xxxxxxxxxxxxxxx" <linux-pci@xxxxxxxxxxxxxxx>
- In-reply-to: <87k0cezarl.fsf@kernel.org>
- References: <20220326165909.506926-1-benni@stuerz.xyz> <20220326165909.506926-21-benni@stuerz.xyz> <f7bb9164-2f66-8985-5771-5f31ee5740b7@lwfinger.net> <87k0cezarl.fsf@kernel.org>
From: Kalle Valo
> Sent: 28 March 2022 10:29
>
> Larry Finger <Larry.Finger@xxxxxxxxxxxx> writes:
>
> > On 3/26/22 11:59, Benjamin Stürz wrote:
> >> This replaces comments with C99's designated
> >> initializers because the kernel supports them now.
> >>
> >> Signed-off-by: Benjamin Stürz <benni@xxxxxxxxxx>
> >> ---
> >> drivers/net/wireless/realtek/rtw89/coex.c | 40 +++++++++++------------
> >> 1 file changed, 20 insertions(+), 20 deletions(-)
> >>
> >> diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
> >> index 684583955511..3c83a0bfb120 100644
> >> --- a/drivers/net/wireless/realtek/rtw89/coex.c
> >> +++ b/drivers/net/wireless/realtek/rtw89/coex.c
> >> @@ -97,26 +97,26 @@ static const struct rtw89_btc_fbtc_slot s_def[] = {
> >> };
> >> static const u32 cxtbl[] = {
> >> - 0xffffffff, /* 0 */
> >> - 0xaaaaaaaa, /* 1 */
> >> - 0x55555555, /* 2 */
> >> - 0x66555555, /* 3 */
> >> - 0x66556655, /* 4 */
> >> - 0x5a5a5a5a, /* 5 */
> >> - 0x5a5a5aaa, /* 6 */
> >> - 0xaa5a5a5a, /* 7 */
> >> - 0x6a5a5a5a, /* 8 */
> >> - 0x6a5a5aaa, /* 9 */
> >> - 0x6a5a6a5a, /* 10 */
> >> - 0x6a5a6aaa, /* 11 */
> >> - 0x6afa5afa, /* 12 */
> >> - 0xaaaa5aaa, /* 13 */
> >> - 0xaaffffaa, /* 14 */
> >> - 0xaa5555aa, /* 15 */
> >> - 0xfafafafa, /* 16 */
> >> - 0xffffddff, /* 17 */
> >> - 0xdaffdaff, /* 18 */
> >> - 0xfafadafa /* 19 */
> >> + [0] = 0xffffffff,
> >> + [1] = 0xaaaaaaaa,
> >> + [2] = 0x55555555,
> >> + [3] = 0x66555555,
> >> + [4] = 0x66556655,
> >> + [5] = 0x5a5a5a5a,
> >> + [6] = 0x5a5a5aaa,
> >> + [7] = 0xaa5a5a5a,
> >> + [8] = 0x6a5a5a5a,
> >> + [9] = 0x6a5a5aaa,
> >> + [10] = 0x6a5a6a5a,
> >> + [11] = 0x6a5a6aaa,
> >> + [12] = 0x6afa5afa,
> >> + [13] = 0xaaaa5aaa,
> >> + [14] = 0xaaffffaa,
> >> + [15] = 0xaa5555aa,
> >> + [16] = 0xfafafafa,
> >> + [17] = 0xffffddff,
> >> + [18] = 0xdaffdaff,
> >> + [19] = 0xfafadafa
> >> };
> >> struct rtw89_btc_btf_tlv {
> >
> >
> > Is this change really necessary? Yes, the entries must be ordered;
> > however, the comment carries that information at very few extra
> > characters. To me, this patch looks like unneeded source churn.
>
> One small benefit I see is to avoid the comment index being wrong and
> there would be no way to catch that. But otherwise I don't have any
> opinion about this.
If the [nn] are wrong the effect is probably worse.
You really don't want a gap!
Doesn't seem worth using C99 initialisers unless they are
#defines or enum values.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]