erofs: Replace zero-length array with flexible-array member
authorGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 6 Dec 2021 12:17:02 +0000 (20:17 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 8 Dec 2021 01:42:19 +0000 (09:42 +0800)
commit7acc3d1afd02a956f2a6fbe0e8395698943c9686
tree9e3d49524aff5949c109d8566476c516905d04d3
parent40452ffca3c1a0f2994e826f9fa213b107f1a2d4
erofs: Replace zero-length array with flexible-array member

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].

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

Link: https://lore.kernel.org/r/20211206121702.221331-1-hsiangkao@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/erofs_fs.h