diff mbox series

crypto: fix flexible_array.cocci warnings

Message ID alpine.DEB.2.22.394.2106291346290.4909@hadrien
State New
Headers show
Series crypto: fix flexible_array.cocci warnings | expand

Commit Message

Julia Lawall June 29, 2021, 11:48 a.m. UTC
From: kernel test robot <lkp@intel.com>

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

Fixes: 7540b2861e52 ("crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ")
CC: Megha Dey <megha.dey@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://github.com/meghadey/crypto for_crypto_avx512
head:   a89c5880f0d6260dd593bf579df26f2a2d56ac32
commit: 7540b2861e5292b5993f8e693fc69510b2a7277a [5/6] crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago

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

Comments

Herbert Xu July 16, 2021, 7:26 a.m. UTC | #1
On Tue, Jun 29, 2021 at 01:48:01PM +0200, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>

> 

> 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

> 

> Fixes: 7540b2861e52 ("crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ")

> CC: Megha Dey <megha.dey@intel.com>

> Reported-by: kernel test robot <lkp@intel.com>

> Signed-off-by: kernel test robot <lkp@intel.com>

> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

> ---

> 

> tree:   https://github.com/meghadey/crypto for_crypto_avx512

> head:   a89c5880f0d6260dd593bf579df26f2a2d56ac32

> commit: 7540b2861e5292b5993f8e693fc69510b2a7277a [5/6] crypto: aesni - AVX512 version of AESNI-GCM using VPCLMULQDQ

> :::::: branch date: 7 hours ago

> :::::: commit date: 7 hours ago

> 

>  aesni-intel_glue.c |    2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> --- a/arch/x86/crypto/aesni-intel_glue.c

> +++ b/arch/x86/crypto/aesni-intel_glue.c

> @@ -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[];


Unfortunately this patch doesn't apply to the current crypto tree.
But the good news is that the current tree no longer has a zero-
length array in that struct.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -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,