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/fw.h #287

Closed
GustavoARSilva opened this issue May 15, 2023 · 0 comments
Assignees
Labels
[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/fw.h b/drivers/net/wireless/ath/wil6210/fw.h
--- a/drivers/net/wireless/ath/wil6210/fw.h
+++ b/drivers/net/wireless/ath/wil6210/fw.h
@@ -131,7 +131,7 @@ struct wil_fw_data_dwrite {
  * data_size is @head.size where @head is record header
  */
 struct wil_fw_record_direct_write { /* type == wil_fw_type_direct_write */
-       struct wil_fw_data_dwrite data[0];
+       struct wil_fw_data_dwrite data[];
 } __packed;

 /* verify condition: [@addr] & @mask == @value
@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#287
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
@GustavoARSilva GustavoARSilva added the [PATCH] Exists A patch exists to address the issue label 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#287
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/ZGKHByxujJoygK+l@work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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