2023-12-13 17:07:44

by Jeff Johnson

[permalink] [raw]
Subject: [PATCH 4/6] wifi: ath10k: remove unused template structs

Currently both the wmi_bcn_tmpl_cmd and wmi_prb_tmpl_cmd structs
define:
u8 data[1];

Per the guidance in [1] both instances of this should be flexible
arrays. However during conversion it was discovered that neither of
these structs are actually used, so just remove them.

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 | 24 ------------------------
1 file changed, 24 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 37a7d421bd86..e16410e348ca 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5782,30 +5782,6 @@ struct wmi_bcn_prb_info {
/* app IE */
} __packed;

-struct wmi_bcn_tmpl_cmd {
- /* unique id identifying the VDEV, generated by the caller */
- __le32 vdev_id;
- /* TIM IE offset from the beginning of the template. */
- __le32 tim_ie_offset;
- /* beacon probe capabilities and IEs */
- struct wmi_bcn_prb_info bcn_prb_info;
- /* beacon buffer length */
- __le32 buf_len;
- /* variable length data */
- u8 data[1];
-} __packed;
-
-struct wmi_prb_tmpl_cmd {
- /* unique id identifying the VDEV, generated by the caller */
- __le32 vdev_id;
- /* beacon probe capabilities and IEs */
- struct wmi_bcn_prb_info bcn_prb_info;
- /* beacon buffer length */
- __le32 buf_len;
- /* Variable length data */
- u8 data[1];
-} __packed;
-
enum wmi_sta_ps_mode {
/* enable power save for the given STA VDEV */
WMI_STA_PS_MODE_DISABLED = 0,

--
2.42.0



2023-12-13 19:12:39

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH 4/6] wifi: ath10k: remove unused template structs

On Wed, Dec 13, 2023 at 09:06:42AM -0800, Jeff Johnson wrote:
> Currently both the wmi_bcn_tmpl_cmd and wmi_prb_tmpl_cmd structs
> define:
> u8 data[1];
>
> Per the guidance in [1] both instances of this should be flexible
> arrays. However during conversion it was discovered that neither of
> these structs are actually used, so just remove them.
>
> 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]>

Unused! :)

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

--
Kees Cook

2023-12-13 20:19:19

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH 4/6] wifi: ath10k: remove unused template structs



On 12/13/23 11:06, Jeff Johnson wrote:
> Currently both the wmi_bcn_tmpl_cmd and wmi_prb_tmpl_cmd structs
> define:
> u8 data[1];
>
> Per the guidance in [1] both instances of this should be flexible
> arrays. However during conversion it was discovered that neither of
> these structs are actually used, so just remove them.
>
> 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 | 24 ------------------------
> 1 file changed, 24 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
> index 37a7d421bd86..e16410e348ca 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.h
> +++ b/drivers/net/wireless/ath/ath10k/wmi.h
> @@ -5782,30 +5782,6 @@ struct wmi_bcn_prb_info {
> /* app IE */
> } __packed;
>
> -struct wmi_bcn_tmpl_cmd {
> - /* unique id identifying the VDEV, generated by the caller */
> - __le32 vdev_id;
> - /* TIM IE offset from the beginning of the template. */
> - __le32 tim_ie_offset;
> - /* beacon probe capabilities and IEs */
> - struct wmi_bcn_prb_info bcn_prb_info;
> - /* beacon buffer length */
> - __le32 buf_len;
> - /* variable length data */
> - u8 data[1];
> -} __packed;
> -
> -struct wmi_prb_tmpl_cmd {
> - /* unique id identifying the VDEV, generated by the caller */
> - __le32 vdev_id;
> - /* beacon probe capabilities and IEs */
> - struct wmi_bcn_prb_info bcn_prb_info;
> - /* beacon buffer length */
> - __le32 buf_len;
> - /* Variable length data */
> - u8 data[1];
> -} __packed;
> -
> enum wmi_sta_ps_mode {
> /* enable power save for the given STA VDEV */
> WMI_STA_PS_MODE_DISABLED = 0,
>