All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Stürz" <benni@stuerz.xyz>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: loic.poulain@linaro.org, Kalle Valo <kvalo@kernel.org>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 19/22 v2] wcn36xx: Improve readability of wcn36xx_caps_name
Date: Mon, 28 Mar 2022 20:38:06 +0200	[thread overview]
Message-ID: <720e4d68-683a-f729-f452-4a9e52a3c6fa@stuerz.xyz> (raw)
In-Reply-To: <f0ebc901-051a-c7fe-ca5a-bc798e7c31e7@quicinc.com>

Make the array more readable and easier to maintain.

Signed-off-by: Benjamin Stürz <benni@stuerz.xyz>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 126 ++++++++++++------------
 1 file changed, 65 insertions(+), 61 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c
b/drivers/net/wireless/ath/wcn36xx/main.c
index 95ea7d040d8c..ac9465dfae64 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -192,70 +192,74 @@ static inline u8 get_sta_index(struct
ieee80211_vif *vif,
 	       sta_priv->sta_index;
 }

+#define DEFINE(s) [s] = #s
+
 static const char * const wcn36xx_caps_names[] = {
-	"MCC",				/* 0 */
-	"P2P",				/* 1 */
-	"DOT11AC",			/* 2 */
-	"SLM_SESSIONIZATION",		/* 3 */
-	"DOT11AC_OPMODE",		/* 4 */
-	"SAP32STA",			/* 5 */
-	"TDLS",				/* 6 */
-	"P2P_GO_NOA_DECOUPLE_INIT_SCAN",/* 7 */
-	"WLANACTIVE_OFFLOAD",		/* 8 */
-	"BEACON_OFFLOAD",		/* 9 */
-	"SCAN_OFFLOAD",			/* 10 */
-	"ROAM_OFFLOAD",			/* 11 */
-	"BCN_MISS_OFFLOAD",		/* 12 */
-	"STA_POWERSAVE",		/* 13 */
-	"STA_ADVANCED_PWRSAVE",		/* 14 */
-	"AP_UAPSD",			/* 15 */
-	"AP_DFS",			/* 16 */
-	"BLOCKACK",			/* 17 */
-	"PHY_ERR",			/* 18 */
-	"BCN_FILTER",			/* 19 */
-	"RTT",				/* 20 */
-	"RATECTRL",			/* 21 */
-	"WOW",				/* 22 */
-	"WLAN_ROAM_SCAN_OFFLOAD",	/* 23 */
-	"SPECULATIVE_PS_POLL",		/* 24 */
-	"SCAN_SCH",			/* 25 */
-	"IBSS_HEARTBEAT_OFFLOAD",	/* 26 */
-	"WLAN_SCAN_OFFLOAD",		/* 27 */
-	"WLAN_PERIODIC_TX_PTRN",	/* 28 */
-	"ADVANCE_TDLS",			/* 29 */
-	"BATCH_SCAN",			/* 30 */
-	"FW_IN_TX_PATH",		/* 31 */
-	"EXTENDED_NSOFFLOAD_SLOT",	/* 32 */
-	"CH_SWITCH_V1",			/* 33 */
-	"HT40_OBSS_SCAN",		/* 34 */
-	"UPDATE_CHANNEL_LIST",		/* 35 */
-	"WLAN_MCADDR_FLT",		/* 36 */
-	"WLAN_CH144",			/* 37 */
-	"NAN",				/* 38 */
-	"TDLS_SCAN_COEXISTENCE",	/* 39 */
-	"LINK_LAYER_STATS_MEAS",	/* 40 */
-	"MU_MIMO",			/* 41 */
-	"EXTENDED_SCAN",		/* 42 */
-	"DYNAMIC_WMM_PS",		/* 43 */
-	"MAC_SPOOFED_SCAN",		/* 44 */
-	"BMU_ERROR_GENERIC_RECOVERY",	/* 45 */
-	"DISA",				/* 46 */
-	"FW_STATS",			/* 47 */
-	"WPS_PRBRSP_TMPL",		/* 48 */
-	"BCN_IE_FLT_DELTA",		/* 49 */
-	"TDLS_OFF_CHANNEL",		/* 51 */
-	"RTT3",				/* 52 */
-	"MGMT_FRAME_LOGGING",		/* 53 */
-	"ENHANCED_TXBD_COMPLETION",	/* 54 */
-	"LOGGING_ENHANCEMENT",		/* 55 */
-	"EXT_SCAN_ENHANCED",		/* 56 */
-	"MEMORY_DUMP_SUPPORTED",	/* 57 */
-	"PER_PKT_STATS_SUPPORTED",	/* 58 */
-	"EXT_LL_STAT",			/* 60 */
-	"WIFI_CONFIG",			/* 61 */
-	"ANTENNA_DIVERSITY_SELECTION",	/* 62 */
+	DEFINE(MCC),
+	DEFINE(P2P),
+	DEFINE(DOT11AC),
+	DEFINE(SLM_SESSIONIZATION),
+	DEFINE(DOT11AC_OPMODE),
+	DEFINE(SAP32STA),
+	DEFINE(TDLS),
+	DEFINE(P2P_GO_NOA_DECOUPLE_INIT_SCAN),
+	DEFINE(WLANACTIVE_OFFLOAD),
+	DEFINE(BEACON_OFFLOAD),
+	DEFINE(SCAN_OFFLOAD),
+	DEFINE(ROAM_OFFLOAD),
+	DEFINE(BCN_MISS_OFFLOAD),
+	DEFINE(STA_POWERSAVE),
+	DEFINE(STA_ADVANCED_PWRSAVE),
+	DEFINE(AP_UAPSD),
+	DEFINE(AP_DFS),
+	DEFINE(BLOCKACK),
+	DEFINE(PHY_ERR),
+	DEFINE(BCN_FILTER),
+	DEFINE(RTT),
+	DEFINE(RATECTRL),
+	DEFINE(WOW),
+	DEFINE(WLAN_ROAM_SCAN_OFFLOAD),
+	DEFINE(SPECULATIVE_PS_POLL),
+	DEFINE(SCAN_SCH),
+	DEFINE(IBSS_HEARTBEAT_OFFLOAD),
+	DEFINE(WLAN_SCAN_OFFLOAD),
+	DEFINE(WLAN_PERIODIC_TX_PTRN),
+	DEFINE(ADVANCE_TDLS),
+	DEFINE(BATCH_SCAN),
+	DEFINE(FW_IN_TX_PATH),
+	DEFINE(EXTENDED_NSOFFLOAD_SLOT),
+	DEFINE(CH_SWITCH_V1),
+	DEFINE(HT40_OBSS_SCAN),
+	DEFINE(UPDATE_CHANNEL_LIST),
+	DEFINE(WLAN_MCADDR_FLT),
+	DEFINE(WLAN_CH144),
+	DEFINE(NAN),
+	DEFINE(TDLS_SCAN_COEXISTENCE),
+	DEFINE(LINK_LAYER_STATS_MEAS),
+	DEFINE(MU_MIMO),
+	DEFINE(EXTENDED_SCAN),
+	DEFINE(DYNAMIC_WMM_PS),
+	DEFINE(MAC_SPOOFED_SCAN),
+	DEFINE(BMU_ERROR_GENERIC_RECOVERY),
+	DEFINE(DISA),
+	DEFINE(FW_STATS),
+	DEFINE(WPS_PRBRSP_TMPL),
+	DEFINE(BCN_IE_FLT_DELTA),
+	DEFINE(TDLS_OFF_CHANNEL),
+	DEFINE(RTT3),
+	DEFINE(MGMT_FRAME_LOGGING),
+	DEFINE(ENHANCED_TXBD_COMPLETION),
+	DEFINE(LOGGING_ENHANCEMENT),
+	DEFINE(EXT_SCAN_ENHANCED),
+	DEFINE(MEMORY_DUMP_SUPPORTED),
+	DEFINE(PER_PKT_STATS_SUPPORTED),
+	DEFINE(EXT_LL_STAT),
+	DEFINE(WIFI_CONFIG),
+	DEFINE(ANTENNA_DIVERSITY_SELECTION),
 };

+#undef DEFINE
+
 static const char *wcn36xx_get_cap_name(enum place_holder_in_cap_bitmap x)
 {
 	if (x >= ARRAY_SIZE(wcn36xx_caps_names))
-- 
2.35.1

  reply	other threads:[~2022-03-28 18:38 UTC|newest]

Thread overview: 177+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-26 16:58 [PATCH 01/22] orion5x: Replace comments with C99 initializers Benjamin Stürz
2022-03-26 16:58 ` Benjamin Stürz
2022-03-26 16:58 ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 02/22] s3c: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 19:44   ` Joe Perches
2022-03-26 19:44     ` Joe Perches
2022-03-26 19:44     ` Joe Perches
2022-03-28 13:37   ` Daniel Thompson
2022-03-28 13:37     ` Daniel Thompson
2022-03-28 13:37     ` Daniel Thompson
2022-03-26 16:58 ` [PATCH 03/22] ia64: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 04/22] x86: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-28 23:08   ` Thomas Gleixner
2022-03-28 23:08     ` Thomas Gleixner
2022-03-28 23:08     ` Thomas Gleixner
2022-03-26 16:58 ` [PATCH 05/22] acpica: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-27 19:59   ` Andy Shevchenko
2022-03-27 19:59     ` Andy Shevchenko
2022-03-27 19:59     ` Andy Shevchenko
2022-03-31 19:27     ` Moore, Robert
2022-03-31 19:27       ` Moore, Robert
2022-03-31 19:27       ` Moore, Robert
2022-04-01  5:09       ` Christoph Hellwig
2022-04-01  5:09         ` Christoph Hellwig
2022-04-01  5:09         ` Christoph Hellwig
2022-04-01  5:10     ` Christoph Hellwig
2022-04-01  5:10       ` Christoph Hellwig
2022-04-01  5:10       ` Christoph Hellwig
2022-03-28 12:33   ` Rafael J. Wysocki
2022-03-28 12:33     ` [Devel] " Rafael J. Wysocki
2022-03-28 12:33     ` Rafael J. Wysocki
2022-03-28 12:33     ` Rafael J. Wysocki
2022-03-26 16:58 ` [PATCH 06/22] idt77252: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 07/22] cm4000: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 08/22] i5100: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 09/22] gpio-winbond: Use " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-27 12:03   ` Linus Walleij
2022-03-27 12:03     ` Linus Walleij
2022-03-27 12:03     ` Linus Walleij
2022-03-29 12:30   ` Bartosz Golaszewski
2022-03-29 12:30     ` Bartosz Golaszewski
2022-03-29 12:30     ` Bartosz Golaszewski
2022-03-26 16:58 ` [PATCH 10/22] hfi1: Replace comments with " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58 ` [PATCH 11/22] rdmavt: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-27  7:04   ` Leon Romanovsky
2022-03-27  7:04     ` Leon Romanovsky
2022-03-27  7:04     ` Leon Romanovsky
2022-03-31 17:41     ` Dennis Dalessandro
2022-03-31 17:41       ` Dennis Dalessandro
2022-03-31 17:41       ` Dennis Dalessandro
2022-03-26 16:58 ` [PATCH 12/22] alps: " Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:58   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 13/22] capi: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 14/22] mISDN: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 15/22] macintosh: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 16/22] dvb-usb: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 18:24   ` Mauro Carvalho Chehab
2022-03-26 18:24     ` Mauro Carvalho Chehab
2022-03-26 18:24     ` Mauro Carvalho Chehab
2022-03-26 18:27     ` Mauro Carvalho Chehab
2022-03-26 18:27       ` Mauro Carvalho Chehab
2022-03-26 18:27       ` Mauro Carvalho Chehab
2022-03-26 19:51       ` Joe Perches
2022-03-26 19:51         ` Joe Perches
2022-03-26 19:51         ` Joe Perches
2022-03-26 20:11         ` Larry Finger
2022-03-26 20:11           ` Larry Finger
2022-03-26 20:11           ` Larry Finger
2022-03-26 21:08           ` Mauro Carvalho Chehab
2022-03-26 21:08             ` Mauro Carvalho Chehab
2022-03-26 21:08             ` Mauro Carvalho Chehab
2022-03-28 18:08             ` [PATCH 16/22 v3] " Benjamin Stürz
2022-03-28 20:52               ` Mauro Carvalho Chehab
2022-03-27 13:33   ` [PATCH 16/22 v2] " Benjamin Stürz
2022-03-26 16:59 ` [PATCH 17/22] cxl: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 18/22] smsc: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59 ` [PATCH 19/22] wnc36xx: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-28 16:17   ` Jeff Johnson
2022-03-28 16:17     ` Jeff Johnson
2022-03-28 16:17     ` Jeff Johnson
2022-03-28 18:38     ` Benjamin Stürz [this message]
2022-03-28 20:23       ` [PATCH 19/22 v2] wcn36xx: Improve readability of wcn36xx_caps_name Jeff Johnson
2022-03-30  7:05         ` Kalle Valo
2022-03-30  8:19           ` Kalle Valo
2022-03-26 16:59 ` [PATCH 20/22] wireless: Replace comments with C99 initializers Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-28 12:06   ` Kalle Valo
2022-03-28 12:06     ` Kalle Valo
2022-03-28 12:06     ` Kalle Valo
2022-03-28 18:21     ` [PATCH 20/22 v2] ray_cs: " Benjamin Stürz
2022-03-28 19:23       ` Joe Perches
2022-03-28 19:54         ` [PATCH 20/22 v3] ray_cs: Improve card_status[] Benjamin Stürz
2022-04-06 11:31           ` Kalle Valo
2022-03-26 16:59 ` [PATCH 21/22] rtw89: Replace comments with C99 initializers Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 18:55   ` Larry Finger
2022-03-26 18:55     ` Larry Finger
2022-03-26 18:55     ` Larry Finger
2022-03-28  9:28     ` Kalle Valo
2022-03-28  9:28       ` Kalle Valo
2022-03-28  9:28       ` Kalle Valo
2022-03-28 12:21       ` David Laight
2022-03-28 12:21         ` David Laight
2022-03-28 12:21         ` David Laight
2022-03-26 16:59 ` [PATCH 22/22] pci: " Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 16:59   ` Benjamin Stürz
2022-03-26 18:20 ` [PATCH 01/22] orion5x: " Mauro Carvalho Chehab
2022-03-26 18:20   ` Mauro Carvalho Chehab
2022-03-26 18:20   ` Mauro Carvalho Chehab
2022-03-26 19:23 ` Arnd Bergmann
2022-03-26 19:23   ` Arnd Bergmann
2022-03-26 19:23   ` Arnd Bergmann
2022-03-28 13:19   ` Segher Boessenkool
2022-03-28 13:19     ` Segher Boessenkool
2022-03-28 13:19     ` Segher Boessenkool
2022-03-27 12:46 ` [PATCH 00/22] " Benjamin Stürz
2022-03-27 12:46   ` Benjamin Stürz
2022-03-27 12:46   ` Benjamin Stürz
2022-03-28  9:33   ` Kalle Valo
2022-03-28  9:33     ` Kalle Valo
2022-03-28  9:33     ` Kalle Valo
2022-03-28 11:51     ` Benjamin Stürz
2022-03-28 11:51       ` Benjamin Stürz
2022-03-28 11:51       ` Benjamin Stürz
2022-03-28 11:51       ` Benjamin Stürz
2022-03-28 12:31       ` Kalle Valo
2022-03-28 12:31         ` Kalle Valo
2022-03-28 12:31         ` Kalle Valo
2022-03-28 12:31         ` Kalle Valo
2022-03-28 20:20       ` Jakub Kicinski
2022-03-28 20:20         ` Jakub Kicinski
2022-03-28 20:20         ` Jakub Kicinski
2022-03-28 20:20         ` Jakub Kicinski
2022-03-28 13:47   ` Daniel Thompson
2022-03-28 13:47     ` Daniel Thompson
2022-03-28 13:47     ` Daniel Thompson
2022-03-28 13:17 ` [PATCH 01/22] orion5x: " Daniel Thompson
2022-03-28 13:17   ` Daniel Thompson
2022-03-28 13:17   ` Daniel Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=720e4d68-683a-f729-f452-4a9e52a3c6fa@stuerz.xyz \
    --to=benni@stuerz.xyz \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_jjohnson@quicinc.com \
    --cc=wcn36xx@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.