WSL2-Linux-Kernel/fs/xfs/scrub
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
..
agheader.c xfs: fix online fsck handling of v5 feature bits on secondary supers 2022-01-12 09:45:21 -08:00
agheader_repair.c xfs: fix online fsck handling of v5 feature bits on secondary supers 2022-01-12 09:45:21 -08:00
alloc.c xfs: mark the record passed into xchk_btree functions as const 2021-08-18 18:46:01 -07:00
attr.c xfs: replace xfs_sb_version checks with feature flag checks 2021-08-19 10:07:12 -07:00
attr.h treewide: Replace zero-length arrays with flexible-array members 2022-02-17 07:00:39 -06:00
bitmap.c xfs: prepare xfs_btree_cur for dynamic cursor heights 2021-10-19 11:45:14 -07:00
bitmap.h
bmap.c xfs: prepare xfs_btree_cur for dynamic cursor heights 2021-10-19 11:45:14 -07:00
btree.c xfs: prepare xfs_btree_cur for dynamic cursor heights 2021-10-19 11:45:14 -07:00
btree.h xfs: dynamically allocate btree scrub context structure 2021-10-19 11:45:14 -07:00
common.c xfs: convert bp->b_bn references to xfs_buf_daddr() 2021-08-19 10:07:15 -07:00
common.h xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
dabtree.c xfs: don't allocate scrub contexts on the stack 2021-10-14 09:19:32 -07:00
dabtree.h
dir.c xfs: fix a bug in the online fsck directory leaf1 bestcount check 2021-12-21 09:49:41 -08:00
fscounters.c xfs: fix perag structure refcounting error when scrub fails 2021-08-20 13:20:33 -07:00
health.c xfs: move xfs_perag_get/put to xfs_ag.[ch] 2021-06-02 10:48:24 +10:00
health.h
ialloc.c xfs: replace xfs_sb_version checks with feature flag checks 2021-08-19 10:07:12 -07:00
inode.c xfs: warn about inodes with project id of -1 2022-01-06 10:43:30 -08:00
parent.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
quota.c xfs: fix quotaoff mutex usage now that we don't support disabling it 2021-12-21 09:49:41 -08:00
refcount.c xfs: mark the record passed into xchk_btree functions as const 2021-08-18 18:46:01 -07:00
repair.c xfs: fix quotaoff mutex usage now that we don't support disabling it 2021-12-21 09:49:41 -08:00
repair.h xfs: stricter btree height checking when scanning for btree roots 2021-10-14 09:19:32 -07:00
rmap.c xfs: mark the record passed into xchk_btree functions as const 2021-08-18 18:46:01 -07:00
rtbitmap.c xfs: make the record pointer passed to query_range functions const 2021-08-18 18:46:01 -07:00
scrub.c xfs: fix quotaoff mutex usage now that we don't support disabling it 2021-12-21 09:49:41 -08:00
scrub.h xfs: fix quotaoff mutex usage now that we don't support disabling it 2021-12-21 09:49:41 -08:00
symlink.c xfs: remove XFS_IFINLINE 2021-04-15 09:35:51 -07:00
trace.c xfs: prepare xfs_btree_cur for dynamic cursor heights 2021-10-19 11:45:14 -07:00
trace.h xfs: prepare xfs_btree_cur for dynamic cursor heights 2021-10-19 11:45:14 -07:00
xfs_scrub.h