From: Kees Cook Date: Fri, 27 May 2022 21:29:53 +0000 (+0100) Subject: media: amphion: Replace zero-length array with flexible-array member X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5455491bf13f6f7d5e337aada51bbfa43842df93;p=linux.git media: amphion: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2][3]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [3] https://github.com/KSPP/linux/issues/78 Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Cc: Ming Qian Cc: Shijie Qin Cc: Zhou Peng Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: ming_qian Reviewed-by: Tommaso Merciai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c index da62bd718fb84..f72c8a506b220 100644 --- a/drivers/media/platform/amphion/vpu_dbg.c +++ b/drivers/media/platform/amphion/vpu_dbg.c @@ -27,7 +27,7 @@ struct print_buf_desc { u32 bytes; u32 read; u32 write; - char buffer[0]; + char buffer[]; }; static char *vb2_stat_name[] = {