crypto: aspeed - Replace zero-length array with flexible-array member
Subsystems (3)
PATCH 1/1 crypto: aspeed - Replace zero-length array with flexible-array member
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct aspeed_sham_ctx with flex-array member.
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 [2].
--- drivers/crypto/aspeed/aspeed-hace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/aspeed/aspeed-hace.h +1 -1
@@ -183,7 +183,7 @@ struct aspeed_sham_ctx {struct aspeed_hace_dev *hace_dev;unsigned long flags;/* hmac flag */ -struct aspeed_sha_hmac_ctx base[0 ]; +struct aspeed_sha_hmac_ctx base[]; };struct aspeed_sham_reqctx {
Signature · 1 line
2.34.1
Quoted 34 lines
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct
aspeed_sham_ctxwith flex-array member.This helps with the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy()and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].Link:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-lengt
h-and-one-element-arrays [1][2]Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/crypto/aspeed/aspeed-hace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/aspeed/aspeed-hace.h +1
-2@@ -183,7 +183,7 @@ struct aspeed_sham_ctx {struct aspeed_hace_dev *hace_dev;unsigned long flags;/* hmac flag */ -struct aspeed_sha_hmac_ctx base[0 ]; +struct aspeed_sha_hmac_ctx base[]; };struct aspeed_sham_reqctx { --
Quoted 1 line
2.34.1
Quoted 5 lines · Gustavo A. R. Silva
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct
aspeed_sham_ctxwith flex-array member.
Quoted 8 lines
This helps with the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy()and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].
Signature · 1 line
Kees Cook
Herbert Xu
maintainerQuoted 9 lines · Gustavo A. R. Silva
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct
aspeed_sham_ctxwith flex-array member.This helps with the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy()and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].
Quoted 7 lines
Link https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/crypto/aspeed/aspeed-hace.h | 2 +- 1 file changed, 1 insertion(+), 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