Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DECLARE_FLEX_ARRAY() helper in drivers/net/wireless/ath/wil6210/wmi.h #288

Closed
GustavoARSilva opened this issue May 15, 2023 · 0 comments
Assignees
Labels
[Idiom] fake flexible array [PATCH] Exists A patch exists to address the issue [Refactor] 0-element array Conversion away from zero-length array

Comments

@GustavoARSilva
Copy link
Collaborator

diff -u -p a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
--- a/drivers/net/wireless/ath/wil6210/wmi.h
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -2763,7 +2763,7 @@ struct wmi_rf_xpm_write_result_event {

 /* WMI_TX_MGMT_PACKET_EVENTID */
 struct wmi_tx_mgmt_packet_event {
-       u8 payload[0];
+       u8 payload[];
 } __packed;

 /* WMI_RX_MGMT_PACKET_EVENTID */
@GustavoARSilva GustavoARSilva added the [Refactor] 0-element array Conversion away from zero-length array label May 15, 2023
@GustavoARSilva GustavoARSilva self-assigned this May 15, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue May 15, 2023
…() helper

Zero-length arrays are deprecated, and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations alone in structs with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members alone in structs.

Link: KSPP#193
Link: KSPP#288
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
@GustavoARSilva GustavoARSilva added [PATCH] Exists A patch exists to address the issue [Idiom] fake flexible array labels May 16, 2023
1054009064 pushed a commit to 1054009064/linux that referenced this issue May 25, 2023
…() helper

Zero-length arrays are deprecated, and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations alone in structs with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members alone in structs.

Link: KSPP#193
Link: KSPP#288
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/ZGKHM+MWFsuqzTjm@work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Idiom] fake flexible array [PATCH] Exists A patch exists to address the issue [Refactor] 0-element array Conversion away from zero-length array
Projects
None yet
Development

No branches or pull requests

1 participant