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/input/keyboard/applespi.c #219

Closed
GustavoARSilva opened this issue Sep 26, 2022 · 0 comments
Closed
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

c
--- ./drivers/input/keyboard/applespi.c
+++ /tmp/nothing/drivers/input/keyboard/applespi.c
@@ -311,7 +311,6 @@ struct message {
                struct command_protocol_mt_init init_mt_command;
                struct command_protocol_capsl   capsl_command;
                struct command_protocol_bl      bl_command;
-               u8                              data[0];
        };
 };


@GustavoARSilva GustavoARSilva self-assigned this Sep 26, 2022
@GustavoARSilva GustavoARSilva added the [PATCH] Exists A patch exists to address the issue label Sep 26, 2022
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 27, 2022
… helper

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

This helper allows for flexible-array members in unions.

Link: KSPP#193
Link: KSPP#219
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/YzIeJeqU73G+UI8g@work
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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