public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: <guo.ziliang@zte.com.cn>
To: <gustavoars@kernel.org>
Cc: <robh+dt@kernel.org>, <frowand.list@gmail.com>,
	<keescook@chromium.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <guo.ziliang@zte.com.cn>
Subject: [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Date: Tue, 15 Nov 2022 09:03:27 +0800 (CST)	[thread overview]
Message-ID: <202211150903277271642@zte.com.cn> (raw)

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

             reply	other threads:[~2022-11-15  1:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15  1:03 guo.ziliang [this message]
2022-11-15  1:15 ` [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Gustavo A. R. Silva
2022-11-15 14:53 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211150903277271642@zte.com.cn \
    --to=guo.ziliang@zte.com.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox