linux/arch/xtensa
Gustavo A. R. Silva 5224f79096 treewide: Replace zero-length arrays with flexible-array members
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

This code was transformed with the help of Coccinelle:
(next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)

@@
identifier S, member, array;
type T1, T2;
@@

struct S {
  ...
  T1 member;
  T2 array[
- 0
  ];
};

UAPI and wireless changes were intentionally excluded from this patch
and will be sent out separately.

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2022-02-17 07:00:39 -06:00
..
boot kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
configs rcu: Fix undefined Kconfig macros 2021-09-13 16:32:46 -07:00
include treewide: Replace zero-length arrays with flexible-array members 2022-02-17 07:00:39 -06:00
kernel Merge branch 'signal-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2022-01-17 05:49:30 +02:00
lib xtensa: don't use a12 in __xtensa_copy_user in call0 ABI 2021-10-18 22:19:34 -07:00
mm mm: remove redundant check about FAULT_FLAG_ALLOW_RETRY bit 2022-01-15 16:30:27 +02:00
platforms proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
variants xtensa: add test_kc705_be variant 2018-08-20 12:34:45 -07:00
Kbuild xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild 2021-08-11 11:37:13 -07:00
Kconfig futex: Remove futex_cmpxchg detection 2021-11-25 00:02:28 +01:00
Kconfig.debug xtensa: make stack dump size configurable 2019-11-26 11:33:39 -08:00
Makefile kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00