Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: talitos - Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members in unions.

Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/216
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Gustavo A. R. Silva and committed by
Herbert Xu
224f3a05 237f9ece

+2 -2
+2 -2
drivers/crypto/talitos.h
··· 65 65 dma_addr_t dma_link_tbl; 66 66 struct talitos_desc desc; 67 67 union { 68 - struct talitos_ptr link_tbl[0]; 69 - u8 buf[0]; 68 + DECLARE_FLEX_ARRAY(struct talitos_ptr, link_tbl); 69 + DECLARE_FLEX_ARRAY(u8, buf); 70 70 }; 71 71 }; 72 72