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

Replace one-element array flex-array member in drivers/net/ethernet/intel/iavf/iavf_client.h #289

Closed
GustavoARSilva opened this issue May 16, 2023 · 2 comments
Labels
[Idiom] fake flexible array [Linux] v6.6 Released in Linux kernel v6.6 [Refactor] 1-element array Conversion away from one-element array

Comments

@GustavoARSilva
Copy link
Collaborator

diff --git a/drivers/net/ethernet/intel/iavf/iavf_client.h b/drivers/net/ethernet/intel/iavf/iavf_client.h
index c5d51d7dc7cc..500269bc0f5b 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_client.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_client.h
@@ -53,7 +53,7 @@ struct iavf_qv_info {
 
 struct iavf_qvlist_info {
        u32 num_vectors;
-       struct iavf_qv_info qv_info[1];
+       struct iavf_qv_info qv_info[];
 };
 
 #define IAVF_CLIENT_MSIX_ALL 0xFFFFFFFF
@GustavoARSilva GustavoARSilva self-assigned this May 16, 2023
@GustavoARSilva GustavoARSilva added the [PATCH] Exists A patch exists to address the issue label May 16, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue May 16, 2023
One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in struct iavf_qvlist_info, and refactor the rest of the code,
accordingly.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [1].

Link: KSPP#79
Link: KSPP#289
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
@GustavoARSilva
Copy link
Collaborator Author

@kees kees added [Linux] v6.6 Released in Linux kernel v6.6 and removed [PATCH] Exists A patch exists to address the issue labels Feb 6, 2024
@kees
Copy link

kees commented Feb 6, 2024

Fixed in commit b0654e6.

@kees kees closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Idiom] fake flexible array [Linux] v6.6 Released in Linux kernel v6.6 [Refactor] 1-element array Conversion away from one-element array
Projects
None yet
Development

No branches or pull requests

2 participants