Skip to contentSkip to conversation

crypto: sun8i-ss - Avoid -Wflex-array-member-not-at-end warning

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Nov 24, 2025 – Dec 19, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: sun8i-ss - Avoid -Wflex-array-member-not-at-end warning

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Move the conflicting declaration to the end of the corresponding structure. Notice that struct ahash_request is a flexible structure, this is a structure that contains a flexible-array member.

With these changes fix the following warning:

drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h:251:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h +3 -1
index ae66eb45fb24..3fc86225edaf 100644
@@ -248,9 +248,11 @@ struct sun8i_ss_hash_tfm_ctx {
 struct sun8i_ss_hash_reqctx {
 	struct sginfo t_src[MAX_SG];
 	struct sginfo t_dst[MAX_SG];
-	struct ahash_request fallback_req;
 	u32 method;
 	int flow;
+
+	/* Must be last as it ends in a flexible-array member. */
+	struct ahash_request fallback_req;
 };
 
 /*
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 7 lines · Gustavo A. R. Silva

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Move the conflicting declaration to the end of the corresponding structure. Notice that struct ahash_request is a flexible structure, this is a structure that contains a flexible-array member.

Quoted 8 lines

With these changes fix the following warning:

drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h:251:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt