public inbox for linux-hardening@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
       [not found] <202211150903277271642@zte.com.cn>
@ 2022-11-15  1:15 ` Gustavo A. R. Silva
  0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2022-11-15  1:15 UTC (permalink / raw)
  To: guo.ziliang
  Cc: robh+dt, frowand.list, keescook, devicetree, linux-kernel,
	linux-hardening

On Tue, Nov 15, 2022 at 09:03:27AM +0800, guo.ziliang@zte.com.cn wrote:
> 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);
>  };

This was addressed in commit:

        5224f7909617 ("treewide: Replace zero-length arrays with flexible-array members")

My question here is why these changes were reverted by commit:

        ea3723a541c1 ("scripts/dtc: Update to upstream version v1.6.1-63-g55778a03df61")

?? :O

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-15  1:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <202211150903277271642@zte.com.cn>
2022-11-15  1:15 ` [PATCH linux-next] scripts/dtc: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Gustavo A. R. Silva

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