Thread (48 messages) 48 messages, 18 authors, 2022-04-01

Re: [PATCH 21/22] rtw89: Replace comments with C99 initializers

From: Larry Finger <hidden>
Date: 2022-03-26 18:55:44
Also in: linux-acpi, linux-edac, linux-gpio, linux-input, linux-media, linux-pci, linux-rdma, linux-samsung-soc, linux-wireless, lkml, netdev

On 3/26/22 11:59, Benjamin Stürz wrote:
quoted hunk ↗ jump to hunk
This replaces comments with C99's designated
initializers because the kernel supports them now.

Signed-off-by: Benjamin Stürz <redacted>
---
  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 other concern is that this driver is 
backported to older kernels and older compilers by several distros. Will this 
change require adding extra conditional statements to the source used in these 
applications?

Larry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help