[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211150903277271642@zte.com.cn>
Date: Tue, 15 Nov 2022 09:03:27 +0800 (CST)
From: <guo.ziliang@....com.cn>
To: <gustavoars@...nel.org>
Cc: <robh+dt@...nel.org>, <frowand.list@...il.com>,
<keescook@...omium.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <guo.ziliang@....com.cn>
Subject: [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
From: guo ziliang <guo.ziliang@....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@....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
Powered by blists - more mailing lists