2022-03-27 16:59:23

by Benjamin Stürz

[permalink] [raw]
Subject: [PATCH 01/22] orion5x: Replace comments with C99 initializers

This replaces comments with C99's designated
initializers because the kernel supports them now.

Signed-off-by: Benjamin Stürz <[email protected]>
---
arch/arm/mach-orion5x/dns323-setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 87cb47220e82..d762248c6512 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -61,9 +61,9 @@

/* Exposed to userspace, do not change */
enum {
- DNS323_REV_A1, /* 0 */
- DNS323_REV_B1, /* 1 */
- DNS323_REV_C1, /* 2 */
+ DNS323_REV_A1 = 0,
+ DNS323_REV_B1 = 1,
+ DNS323_REV_C1 = 2,
};


--
2.35.1


2022-03-27 18:20:07

by Benjamin Stürz

[permalink] [raw]
Subject: [PATCH 21/22] rtw89: Replace comments with C99 initializers

This replaces comments with C99's designated
initializers because the kernel supports them now.

Signed-off-by: Benjamin Stürz <[email protected]>
---
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 {
--
2.35.1

2022-03-27 21:41:50

by Benjamin Stürz

[permalink] [raw]
Subject: [PATCH 19/22] wnc36xx: Replace comments with C99 initializers

This replaces comments with C99's designated
initializers because the kernel supports them now.

Signed-off-by: Benjamin Stürz <[email protected]>
---
drivers/net/wireless/ath/wcn36xx/main.c | 122 ++++++++++++------------
1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 95ea7d040d8c..0fed64bd37b4 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -193,67 +193,67 @@ static inline u8 get_sta_index(struct ieee80211_vif *vif,
}

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

static const char *wcn36xx_get_cap_name(enum place_holder_in_cap_bitmap x)
--
2.35.1

2022-03-28 03:15:23

by Benjamin Stürz

[permalink] [raw]
Subject: [PATCH 08/22] i5100: Replace comments with C99 initializers

This replaces comments with C99's designated
initializers because the kernel supports them now.

Signed-off-by: Benjamin Stürz <[email protected]>
---
drivers/edac/i5100_edac.c | 44 +++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index 324a46b8479b..5992f0ee5f28 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -379,28 +379,28 @@ static int i5100_rank_to_slot(const struct mem_ctl_info *mci,
static const char *i5100_err_msg(unsigned err)
{
static const char *merrs[] = {
- "unknown", /* 0 */
- "uncorrectable data ECC on replay", /* 1 */
- "unknown", /* 2 */
- "unknown", /* 3 */
- "aliased uncorrectable demand data ECC", /* 4 */
- "aliased uncorrectable spare-copy data ECC", /* 5 */
- "aliased uncorrectable patrol data ECC", /* 6 */
- "unknown", /* 7 */
- "unknown", /* 8 */
- "unknown", /* 9 */
- "non-aliased uncorrectable demand data ECC", /* 10 */
- "non-aliased uncorrectable spare-copy data ECC", /* 11 */
- "non-aliased uncorrectable patrol data ECC", /* 12 */
- "unknown", /* 13 */
- "correctable demand data ECC", /* 14 */
- "correctable spare-copy data ECC", /* 15 */
- "correctable patrol data ECC", /* 16 */
- "unknown", /* 17 */
- "SPD protocol error", /* 18 */
- "unknown", /* 19 */
- "spare copy initiated", /* 20 */
- "spare copy completed", /* 21 */
+ [0] = "unknown",
+ [1] = "uncorrectable data ECC on replay",
+ [2] = "unknown",
+ [3] = "unknown",
+ [4] = "aliased uncorrectable demand data ECC",
+ [5] = "aliased uncorrectable spare-copy data ECC",
+ [6] = "aliased uncorrectable patrol data ECC",
+ [7] = "unknown",
+ [8] = "unknown",
+ [9] = "unknown",
+ [10] = "non-aliased uncorrectable demand data ECC",
+ [11] = "non-aliased uncorrectable spare-copy data ECC",
+ [12] = "non-aliased uncorrectable patrol data ECC",
+ [13] = "unknown",
+ [14] = "correctable demand data ECC",
+ [15] = "correctable spare-copy data ECC",
+ [16] = "correctable patrol data ECC",
+ [17] = "unknown",
+ [18] = "SPD protocol error",
+ [19] = "unknown",
+ [20] = "spare copy initiated",
+ [21] = "spare copy completed",
};
unsigned i;

--
2.35.1

2022-03-28 17:45:55

by Daniel Thompson

[permalink] [raw]
Subject: Re: [PATCH 01/22] orion5x: Replace comments with C99 initializers

On Sat, Mar 26, 2022 at 05:58:48PM +0100, Benjamin St?rz wrote:
> This replaces comments with C99's designated
> initializers because the kernel supports them now.

This commit description seems wrong to me. This patch doesn't include
use C99 designated initializers (or AFAICT any other language feature
that has recently been enabled in the kernel).

The changes here are just plain constant-expressions in enumeration
lists and were included in C89/C90.


Daniel.


>
> Signed-off-by: Benjamin St?rz <[email protected]>
> ---
> arch/arm/mach-orion5x/dns323-setup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
> index 87cb47220e82..d762248c6512 100644
> --- a/arch/arm/mach-orion5x/dns323-setup.c
> +++ b/arch/arm/mach-orion5x/dns323-setup.c
> @@ -61,9 +61,9 @@
>
> /* Exposed to userspace, do not change */
> enum {
> - DNS323_REV_A1, /* 0 */
> - DNS323_REV_B1, /* 1 */
> - DNS323_REV_C1, /* 2 */
> + DNS323_REV_A1 = 0,
> + DNS323_REV_B1 = 1,
> + DNS323_REV_C1 = 2,
> };
>
>
> --
> 2.35.1
>

2022-03-28 17:52:48

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 19/22] wnc36xx: Replace comments with C99 initializers

On 3/26/2022 9:59 AM, Benjamin Stürz wrote:
> This replaces comments with C99's designated
> initializers because the kernel supports them now.
>
> Signed-off-by: Benjamin Stürz <[email protected]>
> ---
> drivers/net/wireless/ath/wcn36xx/main.c | 122 ++++++++++++------------
> 1 file changed, 61 insertions(+), 61 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index 95ea7d040d8c..0fed64bd37b4 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -193,67 +193,67 @@ static inline u8 get_sta_index(struct ieee80211_vif *vif,
> }
>
> 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 */
> + [0] = "MCC",
> + [1] = "P2P",
> + [2] = "DOT11AC",
> + [3] = "SLM_SESSIONIZATION",
> + [4] = "DOT11AC_OPMODE",
> + [5] = "SAP32STA",
> + [6] = "TDLS",
> + [7] = "P2P_GO_NOA_DECOUPLE_INIT_SCAN",
> + [8] = "WLANACTIVE_OFFLOAD",
> + [9] = "BEACON_OFFLOAD",
> + [10] = "SCAN_OFFLOAD",
> + [11] = "ROAM_OFFLOAD",
> + [12] = "BCN_MISS_OFFLOAD",
> + [13] = "STA_POWERSAVE",
> + [14] = "STA_ADVANCED_PWRSAVE",
> + [15] = "AP_UAPSD",
> + [16] = "AP_DFS",
> + [17] = "BLOCKACK",
> + [18] = "PHY_ERR",
> + [19] = "BCN_FILTER",
> + [20] = "RTT",
> + [21] = "RATECTRL",
> + [22] = "WOW",
> + [23] = "WLAN_ROAM_SCAN_OFFLOAD",
> + [24] = "SPECULATIVE_PS_POLL",
> + [25] = "SCAN_SCH",
> + [26] = "IBSS_HEARTBEAT_OFFLOAD",
> + [27] = "WLAN_SCAN_OFFLOAD",
> + [28] = "WLAN_PERIODIC_TX_PTRN",
> + [29] = "ADVANCE_TDLS",
> + [30] = "BATCH_SCAN",
> + [31] = "FW_IN_TX_PATH",
> + [32] = "EXTENDED_NSOFFLOAD_SLOT",
> + [33] = "CH_SWITCH_V1",
> + [34] = "HT40_OBSS_SCAN",
> + [35] = "UPDATE_CHANNEL_LIST",
> + [36] = "WLAN_MCADDR_FLT",
> + [37] = "WLAN_CH144",
> + [38] = "NAN",
> + [39] = "TDLS_SCAN_COEXISTENCE",
> + [40] = "LINK_LAYER_STATS_MEAS",
> + [41] = "MU_MIMO",
> + [42] = "EXTENDED_SCAN",
> + [43] = "DYNAMIC_WMM_PS",
> + [44] = "MAC_SPOOFED_SCAN",
> + [45] = "BMU_ERROR_GENERIC_RECOVERY",
> + [46] = "DISA",
> + [47] = "FW_STATS",
> + [48] = "WPS_PRBRSP_TMPL",
> + [49] = "BCN_IE_FLT_DELTA",
> + [51] = "TDLS_OFF_CHANNEL",
> + [52] = "RTT3",
> + [53] = "MGMT_FRAME_LOGGING",
> + [54] = "ENHANCED_TXBD_COMPLETION",
> + [55] = "LOGGING_ENHANCEMENT",
> + [56] = "EXT_SCAN_ENHANCED",
> + [57] = "MEMORY_DUMP_SUPPORTED",
> + [58] = "PER_PKT_STATS_SUPPORTED",
> + [60] = "EXT_LL_STAT",
> + [61] = "WIFI_CONFIG",
> + [62] = "ANTENNA_DIVERSITY_SELECTION",
> };
>
> static const char *wcn36xx_get_cap_name(enum place_holder_in_cap_bitmap x)

I know there has been much discussion on this series. For this specific
patch this would be a great change if you use the actual enumerations
from enum place_holder_in_cap_bitmap as the index values,
i.e.
[MCC] = "MCC",
etc.

So a v2 for this patch would be appreciated