Skip to contentSkip to conversation

crypto: fix flexible_array.cocci warnings

PATCH In review Julia Lawall 3 participants 3 messages Nov 12, 2021 – Nov 24, 2021

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

PATCH 1/1 crypto: fix flexible_array.cocci warnings

From: kernel test robot <[email protected]>

Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

---

tree:   https://github.com/meghadey/crypto crypto-avx512
head:   9c8c2ca77f6e2575a130bddb9767d068e1162d71
commit: 377aede9f10ee28be954473668bc6d33c6c9db75 [5/6] crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ

:::::: branch date: 7 weeks ago
:::::: commit date: 7 weeks ago

 aesni-intel_glue.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -87,7 +87,7 @@ struct gcm_context_data {
 	u64 partial_block_len;
 	u64 unused;
 	/* Allocate space for hash_keys later */
-	u8 hash_keys[0];
+	u8 hash_keys[];
 };
 
 asmlinkage int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
maintainer
#1 lore raw
Quoted 25 lines · Julia Lawall

From: kernel test robot <[email protected]>

Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

---

tree:   https://github.com/meghadey/crypto crypto-avx512
head:   9c8c2ca77f6e2575a130bddb9767d068e1162d71
commit: 377aede9f10ee28be954473668bc6d33c6c9db75 [5/6] crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ

:::::: branch date: 7 weeks ago
:::::: commit date: 7 weeks ago

 aesni-intel_glue.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

arch/x86/crypto/aesni-intel_glue.c struct gcm_context_data { · line 90

Quoted 5 lines
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -87,7 +87,7 @@ struct gcm_context_data {
 	u64 partial_block_len;
 	u64 unused;
 	/* Allocate space for hash_keys later */
-	u8 hash_keys[0];
+	u8 hash_keys[];

Which tree did this come from? Not only is this not zero in my tree, but it seems to have never been zero in the git history.

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
#2 lore raw

Hi Herbert,

Quoted 9 lines · Herbert Xu
Quoted 8 lines · Julia Lawall

From: kernel test robot <[email protected]>

Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Quoted 8 lines
Quoted 8 lines

---

tree:   https://github.com/meghadey/crypto crypto-avx512
head:   9c8c2ca77f6e2575a130bddb9767d068e1162d71
commit: 377aede9f10ee28be954473668bc6d33c6c9db75 [5/6] crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ

Sorry for the noise, this patch tries to fix the above commit, it seems the commit is still in the private tree, we have fixed it to avoid sending to maintainers.

Best Regards,
Rong Chen

Quoted 20 lines
Quoted 9 lines

:::::: branch date: 7 weeks ago
:::::: commit date: 7 weeks ago

  aesni-intel_glue.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

arch/x86/crypto/aesni-intel_glue.c struct gcm_context_data { · line 90

Quoted 5 lines
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -87,7 +87,7 @@ struct gcm_context_data {
  	u64 partial_block_len;
  	u64 unused;
  	/* Allocate space for hash_keys later */
-	u8 hash_keys[0];
+	u8 hash_keys[];

Which tree did this come from? Not only is this not zero in my tree, but it seems to have never been zero in the git history.

Thanks,