public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
@ 2022-11-15  1:03 guo.ziliang
  2022-11-15  1:15 ` Gustavo A. R. Silva
  2022-11-15 14:53 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: guo.ziliang @ 2022-11-15  1:03 UTC (permalink / raw)
  To: gustavoars
  Cc: robh+dt, frowand.list, keescook, devicetree, linux-kernel,
	guo.ziliang

From: guo ziliang <guo.ziliang@zte.com.cn>

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.

Signed-off-by: guo ziliang <guo.ziliang@zte.com.cn>
---
 scripts/dtc/libfdt/fdt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/dtc/libfdt/fdt.h b/scripts/dtc/libfdt/fdt.h
index f2e6880..f66fff1 100644
--- a/scripts/dtc/libfdt/fdt.h
+++ b/scripts/dtc/libfdt/fdt.h
@@ -35,14 +35,14 @@ struct fdt_reserve_entry {

 struct fdt_node_header {
        fdt32_t tag;
-       char name[0];
+       DECLARE_FLEX_ARRAY(char, name);
 };

 struct fdt_property {
        fdt32_t tag;
        fdt32_t len;
        fdt32_t nameoff;
-       char data[0];
+       DECLARE_FLEX_ARRAY(char, data);
 };

 #endif /* !__ASSEMBLY */
--
1.8.3.1

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

end of thread, other threads:[~2022-11-15 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15  1:03 [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper guo.ziliang
2022-11-15  1:15 ` Gustavo A. R. Silva
2022-11-15 14:53 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox