diff options
author | Richard Yao <[email protected]> | 2023-01-10 15:14:59 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2023-01-12 15:59:41 -0800 |
commit | 8e7ebf4e2d1a7a3d175de54c74869c0d19f290e6 (patch) | |
tree | a554af7d118b82729b3dd9597679be17c2ba6cc1 /module/zfs/dsl_scan.c | |
parent | c9c3ce79765d2f3c2714281f19dcaf711a090ac2 (diff) |
Cleanup: Use C99 flexible array members instead of zero length arrays
The Linux 5.16.14 kernel's coccicheck caught this. The semantic
patch that caught it was:
./scripts/coccinelle/misc/flexible_array.cocci
The Linux kernel's documentation makes a good case for why we should not
use these:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14372
Diffstat (limited to 'module/zfs/dsl_scan.c')
-rw-r--r-- | module/zfs/dsl_scan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index c4b90991a..f9e437f0c 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -281,7 +281,7 @@ typedef struct scan_io { * event of an error. This array must go at the end of the * struct to allow this for the variable number of elements. */ - dva_t sio_dva[0]; + dva_t sio_dva[]; } scan_io_t; #define SIO_SET_OFFSET(sio, x) DVA_SET_OFFSET(&(sio)->sio_dva[0], x) |