LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH linux-next] ipu3: use flexible-array member instead of zero-length array
@ 2021-08-21  3:47 CGEL
  2021-08-23  8:06 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: CGEL @ 2021-08-21  3:47 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Bingbu Cao, Tianshu Qiu, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, linux-media, linux-staging, linux-kernel,
	jing yangyang, Zeal Robot

From: jing yangyang <jing.yangyang@zte.com.cn>

Fix the following coccicheck warning:
./drivers/staging/media/ipu3/ipu3-css-fw.h:174:21-34:i
WARNING: use flexible-array member instead

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 drivers/staging/media/ipu3/ipu3-css-fw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/ipu3/ipu3-css-fw.h b/drivers/staging/media/ipu3/ipu3-css-fw.h
index 3c078f1..c0bc57f 100644
--- a/drivers/staging/media/ipu3/ipu3-css-fw.h
+++ b/drivers/staging/media/ipu3/ipu3-css-fw.h
@@ -171,7 +171,7 @@ struct imgu_fw_bi_file_h {
 
 struct imgu_fw_header {
 	struct imgu_fw_bi_file_h file_header;
-	struct imgu_fw_info binary_header[1];	/* binary_nr items */
+	struct imgu_fw_info binary_header[];	/* binary_nr items */
 };
 
 /******************* Firmware functions *******************/
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] ipu3: use flexible-array member instead of zero-length array
  2021-08-21  3:47 [PATCH linux-next] ipu3: use flexible-array member instead of zero-length array CGEL
@ 2021-08-23  8:06 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2021-08-23  8:06 UTC (permalink / raw)
  To: CGEL
  Cc: Bingbu Cao, Tianshu Qiu, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, linux-media, linux-staging, linux-kernel,
	jing yangyang, Zeal Robot

Hi Jing,

On Fri, Aug 20, 2021 at 08:47:09PM -0700, CGEL wrote:
> From: jing yangyang <jing.yangyang@zte.com.cn>
> 
> Fix the following coccicheck warning:
> ./drivers/staging/media/ipu3/ipu3-css-fw.h:174:21-34:i
> WARNING: use flexible-array member instead
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>

Thanks for the patch.

Gustavo Silva's patch "media: staging/intel-ipu3: css: Fix wrong size
comparison imgu_css_fw_init" has addressed this, and fixed another problem
as well. In other words, removing array entries from structs can have side
effects.

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-23  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21  3:47 [PATCH linux-next] ipu3: use flexible-array member instead of zero-length array CGEL
2021-08-23  8:06 ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).