2023-12-13 17:07:31

by Jeff Johnson

[permalink] [raw]
Subject: [PATCH 3/6] wifi: ath10k: remove struct wmi_pdev_chanlist_update_event

Currently struct wmi_pdev_chanlist_update_event defines:
struct wmi_channel channel_list[1];

Per the guidance in [1] this should be a flexible array. However
during conversion it was discovered that this struct is not used, so
just remove the entire struct.

No functional changes, compile tested only.

[1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays

Signed-off-by: Jeff Johnson <[email protected]>
---
drivers/net/wireless/ath/ath10k/wmi.h | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 52a409ff94e7..37a7d421bd86 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -4256,13 +4256,6 @@ struct wmi_peer_sta_ps_state_chg_event {
__le32 peer_ps_state;
} __packed;

-struct wmi_pdev_chanlist_update_event {
- /* number of channels */
- __le32 num_chan;
- /* array of channels */
- struct wmi_channel channel_list[1];
-} __packed;
-
#define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)

struct wmi_debug_mesg_event {

--
2.42.0



2023-12-13 19:12:14

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH 3/6] wifi: ath10k: remove struct wmi_pdev_chanlist_update_event

On Wed, Dec 13, 2023 at 09:06:41AM -0800, Jeff Johnson wrote:
> Currently struct wmi_pdev_chanlist_update_event defines:
> struct wmi_channel channel_list[1];
>
> Per the guidance in [1] this should be a flexible array. However
> during conversion it was discovered that this struct is not used, so
> just remove the entire struct.
>
> No functional changes, compile tested only.
>
> [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
>
> Signed-off-by: Jeff Johnson <[email protected]>

Removal of unused structs is good. :)

Reviewed-by: Kees Cook <[email protected]>

--
Kees Cook

2023-12-13 20:18:23

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH 3/6] wifi: ath10k: remove struct wmi_pdev_chanlist_update_event



On 12/13/23 11:06, Jeff Johnson wrote:
> Currently struct wmi_pdev_chanlist_update_event defines:
> struct wmi_channel channel_list[1];
>
> Per the guidance in [1] this should be a flexible array. However
> during conversion it was discovered that this struct is not used, so
> just remove the entire struct.

Less code is always great. :)

>
> No functional changes, compile tested only.
>
> [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
>
> Signed-off-by: Jeff Johnson <[email protected]>

Reviewed-by: Gustavo A. R. Silva <[email protected]>

Thanks!
--
Gustavo

> ---
> drivers/net/wireless/ath/ath10k/wmi.h | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
> index 52a409ff94e7..37a7d421bd86 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.h
> +++ b/drivers/net/wireless/ath/ath10k/wmi.h
> @@ -4256,13 +4256,6 @@ struct wmi_peer_sta_ps_state_chg_event {
> __le32 peer_ps_state;
> } __packed;
>
> -struct wmi_pdev_chanlist_update_event {
> - /* number of channels */
> - __le32 num_chan;
> - /* array of channels */
> - struct wmi_channel channel_list[1];
> -} __packed;
> -
> #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
>
> struct wmi_debug_mesg_event {
>