mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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 <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14372
This commit is contained in:
committed by
Brian Behlendorf
parent
c9c3ce7976
commit
8e7ebf4e2d
@@ -50,7 +50,7 @@ typedef struct zone_datasets {
|
||||
typedef struct zone_dataset {
|
||||
struct list_head zd_list; /* zone_dataset linkage */
|
||||
size_t zd_dsnamelen; /* length of name */
|
||||
char zd_dsname[0]; /* name of the member dataset */
|
||||
char zd_dsname[]; /* name of the member dataset */
|
||||
} zone_dataset_t;
|
||||
|
||||
#if defined(CONFIG_USER_NS) && defined(HAVE_USER_NS_COMMON_INUM)
|
||||
|
||||
@@ -71,7 +71,7 @@ typedef struct dio_request {
|
||||
atomic_t dr_ref; /* References */
|
||||
int dr_error; /* Bio error */
|
||||
int dr_bio_count; /* Count of bio's */
|
||||
struct bio *dr_bio[0]; /* Attached bio's */
|
||||
struct bio *dr_bio[]; /* Attached bio's */
|
||||
} dio_request_t;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user