crypto: zstd - replace zero-length array with flexible array member
Subsystems (2)
PATCH 1/1 crypto: zstd - replace zero-length array with flexible array member
Replace the deprecated zero-length array with a modern flexible array member in the struct zstd_ctx.
No functional changes intended.
--- crypto/zstd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/zstd.c +1 -1
@@ -25,7 +25,7 @@ struct zstd_ctx {zstd_dctx *dctx;size_t wksp_size;zstd_parameters params; -u8 wksp[0 ]__aligned(8) ; +u8 wksp[]__aligned(8) ; };static DEFINE_MUTEX (zstd_stream_lock);
Signature · 1 line
2.50.0
Quoted 2 lines · Thorsten Blum
Replace the deprecated zero-length array with a modern flexible array member in the struct
zstd_ctx.
Oh, weird. This is a very recent change. This should include:
Quoted 14 lines
No functional changes intended.
Signed-off-by Thorsten Blum <[email protected]>--- crypto/zstd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)crypto/zstd.c +0
-0
crypto/zstd.c struct zstd_ctx { · line 28
Quoted 5 lines
crypto/zstd.c +1
-1@@ -25,7 +25,7 @@ struct zstd_ctx {zstd_dctx *dctx;size_t wksp_size;zstd_parameters params; -u8 wksp[0 ]__aligned(8) ; +u8 wksp[]__aligned(8) ;
And likely, to use __counted_by(wksp_size)
I'm surprised checkpatch.pl didn't warn, but I guess the __aligned confused the script?
-Kees
Quoted 7 lines
crypto/zstd.c +0
-0};static DEFINE_MUTEX (zstd_stream_lock);Signature · 1 line
2.50.0
Signature · 1 line
Kees Cook
Quoted 1 line · Kees Cook
And likely, to use
__counted_by(wksp_size)
I hesitated because semantically "size" isn't a "count" although the values are the same here.
Quoted 1 line
Reviewed-by Kees Cook <[email protected]>
Thanks!
Quoted 16 lines · Thorsten Blum
Replace the deprecated zero-length array with a modern flexible array member in the struct
zstd_ctx.No functional changes intended.
Signed-off-by Thorsten Blum <[email protected]>--- crypto/zstd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)crypto/zstd.c +0
-0
crypto/zstd.c struct zstd_ctx { · line 28
Quoted 5 lines
crypto/zstd.c +1
-1@@ -25,7 +25,7 @@ struct zstd_ctx {zstd_dctx *dctx;size_t wksp_size;zstd_parameters params; -u8 wksp[0 ]__aligned(8) ; +u8 wksp[]__aligned(8) ;
This is from patch "crypto: zstd - convert to acomp" currently as commit f5ad93ffb54119a8dc in linux-next. Should it rather be folded there? It's part of the crypto queue.
Herbert Xu
maintainerQuoted 10 lines · Thorsten Blum
Replace the deprecated zero-length array with a modern flexible array member in the struct
zstd_ctx.No functional changes intended.
Signed-off-by Thorsten Blum <[email protected]>--- crypto/zstd.c | 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