Commit 94dfc73e authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

treewide: uapi: 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:
(linux-5.19-rc2$ 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
  ];
};

-fstrict-flex-arrays=3 is coming and we need to land these changes
to prevent issues like these in the short future:

../fs/minix/dir.c:337:3: warning: 'strcpy' will always overflow; destination buffer has size 0,
but the source string has length 2 (including NUL byte) [-Wfortify-source]
		strcpy(de3->name, ".");
		^

Since these are all [0] to [] changes, the risk to UAPI is nearly zero. If
this breaks anything, we can use a union with a new member name.

[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/78Build-tested-by: default avatarkernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/62b675ec.wKX6AOZ6cbE71vtF%25lkp@intel.com/
Acked-by: Dan Williams <dan.j.williams@intel.com> # For ndctl.h
Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
parent b13baccc
......@@ -34,7 +34,7 @@
struct bi_record {
__be16 tag; /* tag ID */
__be16 size; /* size of record (in bytes) */
__be32 data[0]; /* data */
__be32 data[]; /* data */
};
......@@ -168,7 +168,7 @@ struct bootversion {
struct {
__be32 machtype;
__be32 version;
} machversions[0];
} machversions[];
} __packed;
#endif /* __ASSEMBLY__ */
......
......@@ -60,7 +60,7 @@ struct ucontext {
sigset_t uc_sigmask;
/* Extended context structures may follow ucontext */
unsigned long long uc_extcontext[0];
unsigned long long uc_extcontext[];
};
#endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
......@@ -30,18 +30,18 @@ struct s390_ctrset_start { /* Set CPUs to operate on */
struct s390_ctrset_setdata { /* Counter set data */
__u32 set; /* Counter set number */
__u32 no_cnts; /* # of counters stored in cv[] */
__u64 cv[0]; /* Counter values (variable length) */
__u64 cv[]; /* Counter values (variable length) */
};
struct s390_ctrset_cpudata { /* Counter set data per CPU */
__u32 cpu_nr; /* CPU number */
__u32 no_sets; /* # of counters sets in data[] */
struct s390_ctrset_setdata data[0];
struct s390_ctrset_setdata data[];
};
struct s390_ctrset_read { /* Structure to get all ctr sets */
__u64 no_cpus; /* Total # of CPUs data taken from */
struct s390_ctrset_cpudata data[0];
struct s390_ctrset_cpudata data[];
};
#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
......
......@@ -52,7 +52,7 @@ struct setup_data {
__u64 next;
__u32 type;
__u32 len;
__u8 data[0];
__u8 data[];
};
/* extensible setup indirect data node */
......
......@@ -198,13 +198,13 @@ struct kvm_msrs {
__u32 nmsrs; /* number of msrs in entries */
__u32 pad;
struct kvm_msr_entry entries[0];
struct kvm_msr_entry entries[];
};
/* for KVM_GET_MSR_INDEX_LIST */
struct kvm_msr_list {
__u32 nmsrs; /* number of msrs in entries */
__u32 indices[0];
__u32 indices[];
};
/* Maximum size of any access bitmap in bytes */
......@@ -241,7 +241,7 @@ struct kvm_cpuid_entry {
struct kvm_cpuid {
__u32 nent;
__u32 padding;
struct kvm_cpuid_entry entries[0];
struct kvm_cpuid_entry entries[];
};
struct kvm_cpuid_entry2 {
......@@ -263,7 +263,7 @@ struct kvm_cpuid_entry2 {
struct kvm_cpuid2 {
__u32 nent;
__u32 padding;
struct kvm_cpuid_entry2 entries[0];
struct kvm_cpuid_entry2 entries[];
};
/* for KVM_GET_PIT and KVM_SET_PIT */
......@@ -389,7 +389,7 @@ struct kvm_xsave {
* the contents of CPUID leaf 0xD on the host.
*/
__u32 region[1024];
__u32 extra[0];
__u32 extra[];
};
#define KVM_MAX_XCRS 16
......@@ -516,7 +516,7 @@ struct kvm_pmu_event_filter {
__u32 fixed_counter_bitmap;
__u32 flags;
__u32 pad[4];
__u64 events[0];
__u64 events[];
};
#define KVM_PMU_EVENT_ALLOW 0
......
......@@ -2123,7 +2123,7 @@ struct i915_context_engines_load_balance {
__u64 mbz64; /* reserved for future use; must be zero */
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __attribute__((packed));
#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
......@@ -2161,7 +2161,7 @@ struct i915_context_engines_bond {
__u64 flags; /* all undefined flags must be zero */
__u64 mbz64[4]; /* reserved for future use; must be zero */
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __attribute__((packed));
#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
......@@ -2288,7 +2288,7 @@ struct i915_context_engines_parallel_submit {
* length = width (i) * num_siblings (j)
* index = j + i * num_siblings
*/
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __packed;
......
......@@ -130,7 +130,7 @@ struct blk_zone_report {
__u64 sector;
__u32 nr_zones;
__u32 flags;
struct blk_zone zones[0];
struct blk_zone zones[];
};
/**
......
......@@ -79,7 +79,7 @@ struct bpf_insn {
/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
struct bpf_lpm_trie_key {
__u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
__u8 data[0]; /* Arbitrary size */
__u8 data[]; /* Arbitrary size */
};
struct bpf_cgroup_storage_key {
......
......@@ -93,7 +93,7 @@ struct btrfs_qgroup_inherit {
__u64 num_ref_copies;
__u64 num_excl_copies;
struct btrfs_qgroup_limit lim;
__u64 qgroups[0];
__u64 qgroups[];
};
struct btrfs_ioctl_qgroup_limit_args {
......@@ -561,7 +561,7 @@ struct btrfs_ioctl_search_args_v2 {
__u64 buf_size; /* in - size of buffer
* out - on EOVERFLOW: needed size
* to store item */
__u64 buf[0]; /* out - found items */
__u64 buf[]; /* out - found items */
};
struct btrfs_ioctl_clone_range_args {
......@@ -632,7 +632,7 @@ struct btrfs_ioctl_same_args {
__u16 dest_count; /* in - total elements in info array */
__u16 reserved1;
__u32 reserved2;
struct btrfs_ioctl_same_extent_info info[0];
struct btrfs_ioctl_same_extent_info info[];
};
struct btrfs_ioctl_space_info {
......@@ -644,7 +644,7 @@ struct btrfs_ioctl_space_info {
struct btrfs_ioctl_space_args {
__u64 space_slots;
__u64 total_spaces;
struct btrfs_ioctl_space_info spaces[0];
struct btrfs_ioctl_space_info spaces[];
};
struct btrfs_data_container {
......@@ -652,7 +652,7 @@ struct btrfs_data_container {
__u32 bytes_missing; /* out -- additional bytes needed for result */
__u32 elem_cnt; /* out */
__u32 elem_missed; /* out */
__u64 val[0]; /* out */
__u64 val[]; /* out */
};
struct btrfs_ioctl_ino_path_args {
......
......@@ -575,7 +575,7 @@ struct btrfs_inode_extref {
__le64 parent_objectid;
__le64 index;
__le16 name_len;
__u8 name[0];
__u8 name[];
/* name goes here */
} __attribute__ ((__packed__));
......
......@@ -71,7 +71,7 @@ struct bcm_msg_head {
struct bcm_timeval ival1, ival2;
canid_t can_id;
__u32 nframes;
struct can_frame frames[0];
struct can_frame frames[];
};
enum {
......
......@@ -75,7 +75,7 @@ struct cn_msg {
__u16 len; /* Length of the following data */
__u16 flags;
__u8 data[0];
__u8 data[];
};
#endif /* _UAPI__CONNECTOR_H */
......@@ -91,7 +91,7 @@ struct cycx_firmware {
unsigned short reserved[6];
char descr[CFM_DESCR_LEN];
struct cycx_fw_info info;
unsigned char image[0];
unsigned char image[];
};
struct cycx_fw_header {
......
......@@ -182,7 +182,7 @@ struct dm_target_spec {
struct dm_target_deps {
__u32 count; /* Array size */
__u32 padding; /* unused */
__u64 dev[0]; /* out */
__u64 dev[]; /* out */
};
/*
......@@ -192,7 +192,7 @@ struct dm_name_list {
__u64 dev;
__u32 next; /* offset to the next record from
the _start_ of this */
char name[0];
char name[];
/*
* The following members can be accessed by taking a pointer that
......@@ -216,7 +216,7 @@ struct dm_target_versions {
__u32 next;
__u32 version[3];
char name[0];
char name[];
};
/*
......@@ -225,7 +225,7 @@ struct dm_target_versions {
struct dm_target_msg {
__u64 sector; /* Device sector */
char message[0];
char message[];
};
/*
......
......@@ -426,7 +426,7 @@ struct dm_ulog_request {
__u32 request_type; /* DM_ULOG_* defined above */
__u32 data_size; /* How much data (not including this struct) */
char data[0];
char data[];
};
#endif /* __DM_LOG_USERSPACE_H__ */
......@@ -257,7 +257,7 @@ struct ethtool_tunable {
__u32 id;
__u32 type_id;
__u32 len;
void *data[0];
void *data[];
};
#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
......@@ -322,7 +322,7 @@ struct ethtool_regs {
__u32 cmd;
__u32 version;
__u32 len;
__u8 data[0];
__u8 data[];
};
/**
......@@ -348,7 +348,7 @@ struct ethtool_eeprom {
__u32 magic;
__u32 offset;
__u32 len;
__u8 data[0];
__u8 data[];
};
/**
......@@ -752,7 +752,7 @@ struct ethtool_gstrings {
__u32 cmd;
__u32 string_set;
__u32 len;
__u8 data[0];
__u8 data[];
};
/**
......@@ -777,7 +777,7 @@ struct ethtool_sset_info {
__u32 cmd;
__u32 reserved;
__u64 sset_mask;
__u32 data[0];
__u32 data[];
};
/**
......@@ -817,7 +817,7 @@ struct ethtool_test {
__u32 flags;
__u32 reserved;
__u32 len;
__u64 data[0];
__u64 data[];
};
/**
......@@ -834,7 +834,7 @@ struct ethtool_test {
struct ethtool_stats {
__u32 cmd;
__u32 n_stats;
__u64 data[0];
__u64 data[];
};
/**
......@@ -851,7 +851,7 @@ struct ethtool_stats {
struct ethtool_perm_addr {
__u32 cmd;
__u32 size;
__u8 data[0];
__u8 data[];
};
/* boolean flags controlling per-interface behavior characteristics.
......@@ -1160,7 +1160,7 @@ struct ethtool_rxnfc {
struct ethtool_rxfh_indir {
__u32 cmd;
__u32 size;
__u32 ring_index[0];
__u32 ring_index[];
};
/**
......@@ -1201,7 +1201,7 @@ struct ethtool_rxfh {
__u8 hfunc;
__u8 rsvd8[3];
__u32 rsvd32;
__u32 rss_config[0];
__u32 rss_config[];
};
#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
......@@ -1286,7 +1286,7 @@ struct ethtool_dump {
__u32 version;
__u32 flag;
__u32 len;
__u8 data[0];
__u8 data[];
};
#define ETH_FW_DUMP_DISABLE 0
......@@ -1318,7 +1318,7 @@ struct ethtool_get_features_block {
struct ethtool_gfeatures {
__u32 cmd;
__u32 size;
struct ethtool_get_features_block features[0];
struct ethtool_get_features_block features[];
};
/**
......@@ -1340,7 +1340,7 @@ struct ethtool_set_features_block {
struct ethtool_sfeatures {
__u32 cmd;
__u32 size;
struct ethtool_set_features_block features[0];
struct ethtool_set_features_block features[];
};
/**
......@@ -2087,7 +2087,7 @@ struct ethtool_link_settings {
__u8 master_slave_state;
__u8 reserved1[1];
__u32 reserved[7];
__u32 link_mode_masks[0];
__u32 link_mode_masks[];
/* layout of link_mode_masks fields:
* __u32 map_supported[link_mode_masks_nwords];
* __u32 map_advertising[link_mode_masks_nwords];
......
......@@ -162,7 +162,7 @@ struct fanotify_event_info_fid {
* Following is an opaque struct file_handle that can be passed as
* an argument to open_by_handle_at(2).
*/
unsigned char handle[0];
unsigned char handle[];
};
/*
......
......@@ -34,7 +34,7 @@ struct fiemap {
__u32 fm_mapped_extents;/* number of extents that were mapped (out) */
__u32 fm_extent_count; /* size of fm_extents array (in) */
__u32 fm_reserved;
struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */
};
#define FIEMAP_MAX_OFFSET (~0ULL)
......
......@@ -118,7 +118,7 @@ struct fw_cdev_event_response {
__u32 type;
__u32 rcode;
__u32 length;
__u32 data[0];
__u32 data[];
};
/**
......@@ -142,7 +142,7 @@ struct fw_cdev_event_request {
__u64 offset;
__u32 handle;
__u32 length;
__u32 data[0];
__u32 data[];
};
/**
......@@ -205,7 +205,7 @@ struct fw_cdev_event_request2 {
__u32 generation;
__u32 handle;
__u32 length;
__u32 data[0];
__u32 data[];
};
/**
......@@ -265,7 +265,7 @@ struct fw_cdev_event_iso_interrupt {
__u32 type;
__u32 cycle;
__u32 header_length;
__u32 header[0];
__u32 header[];
};
/**
......@@ -355,7 +355,7 @@ struct fw_cdev_event_phy_packet {
__u32 type;
__u32 rcode;
__u32 length;
__u32 data[0];
__u32 data[];
};
/**
......@@ -803,7 +803,7 @@ struct fw_cdev_set_iso_channels {
*/
struct fw_cdev_iso_packet {
__u32 control;
__u32 header[0];
__u32 header[];
};
/**
......
......@@ -90,7 +90,7 @@ struct file_dedupe_range {
__u16 dest_count; /* in - total elements in info array */
__u16 reserved1; /* must be zero */
__u32 reserved2; /* must be zero */
struct file_dedupe_range_info info[0];
struct file_dedupe_range_info info[];
};
/* And dynamically-tunable limits and defaults: */
......
......@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
struct af_alg_iv {
__u32 ivlen;
__u8 iv[0];
__u8 iv[];
};
/* Socket options */
......
......@@ -60,7 +60,7 @@ struct arc_rfc1201 {
__u8 proto; /* protocol ID field - varies */
__u8 split_flag; /* for use with split packets */
__be16 sequence; /* sequence number */
__u8 payload[0]; /* space remaining in packet (504 bytes)*/
__u8 payload[]; /* space remaining in packet (504 bytes)*/
};
#define RFC1201_HDR_SIZE 4
......@@ -69,7 +69,7 @@ struct arc_rfc1201 {
*/
struct arc_rfc1051 {
__u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
__u8 payload[0]; /* 507 bytes */
__u8 payload[]; /* 507 bytes */
};
#define RFC1051_HDR_SIZE 1
......@@ -80,7 +80,7 @@ struct arc_rfc1051 {
struct arc_eth_encap {
__u8 proto; /* Always ARC_P_ETHER */
struct ethhdr eth; /* standard ethernet header (yuck!) */
__u8 payload[0]; /* 493 bytes */
__u8 payload[]; /* 493 bytes */
};
#define ETH_ENCAP_HDR_SIZE 14
......
......@@ -122,7 +122,7 @@ struct sockaddr_pppol2tpv3in6 {
struct pppoe_tag {
__be16 tag_type;
__be16 tag_len;
char tag_data[0];
char tag_data[];
} __attribute__ ((packed));
/* Tag identifiers */
......@@ -150,7 +150,7 @@ struct pppoe_hdr {
__u8 code;
__be16 sid;
__be16 length;
struct pppoe_tag tag[0];
struct pppoe_tag tag[];
} __packed;
/* Length of entire PPPoE + PPP header */
......
......@@ -108,7 +108,7 @@ struct tun_pi {
struct tun_filter {
__u16 flags; /* TUN_FLT_ flags see above */
__u16 count; /* Number of addresses */
__u8 addr[0][ETH_ALEN];
__u8 addr[][ETH_ALEN];
};
#endif /* _UAPI__IF_TUN_H */
......@@ -48,7 +48,7 @@ struct igmpv3_grec {
__u8 grec_auxwords;
__be16 grec_nsrcs;
__be32 grec_mca;
__be32 grec_src[0];
__be32 grec_src[];
};
struct igmpv3_report {
......@@ -57,7 +57,7 @@ struct igmpv3_report {
__sum16 csum;
__be16 resv2;
__be16 ngrec;
struct igmpv3_grec grec[0];
struct igmpv3_grec grec[];
};
struct igmpv3_query {
......@@ -78,7 +78,7 @@ struct igmpv3_query {
#endif
__u8 qqic;
__be16 nsrcs;
__be32 srcs[0];
__be32 srcs[];
};
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
......
......@@ -104,7 +104,7 @@ struct inet_diag_hostcond {
__u8 family;
__u8 prefix_len;
int port;
__be32 addr[0];
__be32 addr[];
};
struct inet_diag_markcond {
......
......@@ -23,7 +23,7 @@ struct inotify_event {
__u32 mask; /* watch mask */
__u32 cookie; /* cookie to synchronize two events */
__u32 len; /* length (including nulls) of name */
char name[0]; /* stub for possible name */
char name[]; /* stub for possible name */
};
/* the following are legal, implemented events that user-space can watch for */
......
......@@ -112,13 +112,13 @@ struct ip_auth_hdr {
__be16 reserved;
__be32 spi;
__be32 seq_no; /* Sequence number */
__u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
__u8 auth_data[]; /* Variable len but >=4. Mind the 64 bit alignment! */
};
struct ip_esp_hdr {
__be32 spi;
__be32 seq_no; /* Sequence number */
__u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
__u8 enc_data[]; /* Variable len but >=8. Mind the 64 bit alignment! */
};
struct ip_comp_hdr {
......
......@@ -254,7 +254,7 @@ struct ip_vs_get_dests {
unsigned int num_dests;
/* the real servers */
struct ip_vs_dest_entry entrytable[0];
struct ip_vs_dest_entry entrytable[];
};
......@@ -264,7 +264,7 @@ struct ip_vs_get_services {
unsigned int num_services;
/* service table */
struct ip_vs_service_entry entrytable[0];
struct ip_vs_service_entry entrytable[];
};
......
......@@ -137,7 +137,7 @@ struct iso_path_table{
__u8 name_len[2]; /* 721 */
__u8 extent[4]; /* 731 */
__u8 parent[2]; /* 721 */
char name[0];
char name[];
} __attribute__((packed));
/* high sierra is identical to iso, except that the date is only 6 bytes, and
......@@ -154,7 +154,7 @@ struct iso_directory_record {
__u8 interleave [ISODCL (28, 28)]; /* 711 */
__u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */
__u8 name_len [ISODCL (33, 33)]; /* 711 */
char name [0];
char name [];
} __attribute__((packed));
#define ISOFS_BLOCK_BITS 11
......
......@@ -123,7 +123,7 @@ struct jffs2_raw_dirent
__u8 unused[2];
jint32_t node_crc;
jint32_t name_crc;
__u8 name[0];
__u8 name[];
};
/* The JFFS2 raw inode structure: Used for storage on physical media. */
......@@ -155,7 +155,7 @@ struct jffs2_raw_inode
jint16_t flags; /* See JFFS2_INO_FLAG_* */
jint32_t data_crc; /* CRC for the (compressed) data. */
jint32_t node_crc; /* CRC for the raw inode (excluding data) */
__u8 data[0];
__u8 data[];
};
struct jffs2_raw_xattr {
......@@ -170,7 +170,7 @@ struct jffs2_raw_xattr {
jint16_t value_len;
jint32_t data_crc;
jint32_t node_crc;
__u8 data[0];
__u8 data[];
} __attribute__((packed));
struct jffs2_raw_xref
......@@ -196,7 +196,7 @@ struct jffs2_raw_summary
jint32_t padded; /* sum of the size of padding nodes */
jint32_t sum_crc; /* summary information crc */
jint32_t node_crc; /* node crc */
jint32_t sum[0]; /* inode summary info */
jint32_t sum[]; /* inode summary info */
};
union jffs2_node_union
......
......@@ -13,7 +13,7 @@ struct kcov_remote_arg {
__u32 area_size; /* Length of coverage buffer in words */
__u32 num_handles; /* Size of handles array */
__aligned_u64 common_handle;
__aligned_u64 handles[0];
__aligned_u64 handles[];
};
#define KCOV_REMOTE_MAX_HANDLES 0x100
......
......@@ -542,7 +542,7 @@ struct kvm_coalesced_mmio {
struct kvm_coalesced_mmio_ring {
__u32 first, last;
struct kvm_coalesced_mmio coalesced_mmio[0];
struct kvm_coalesced_mmio coalesced_mmio[];
};
#define KVM_COALESCED_MMIO_MAX \
......@@ -621,7 +621,7 @@ struct kvm_clear_dirty_log {
/* for KVM_SET_SIGNAL_MASK */
struct kvm_signal_mask {
__u32 len;
__u8 sigset[0];
__u8 sigset[];
};
/* for KVM_TPR_ACCESS_REPORTING */
......@@ -1221,7 +1221,7 @@ struct kvm_irq_routing_entry {
struct kvm_irq_routing {
__u32 nr;
__u32 flags;
struct kvm_irq_routing_entry entries[0];
struct kvm_irq_routing_entry entries[];
};
#endif
......@@ -1341,7 +1341,7 @@ struct kvm_dirty_tlb {
struct kvm_reg_list {
__u64 n; /* number of regs */
__u64 reg[0];
__u64 reg[];
};
struct kvm_one_reg {
......
......@@ -97,11 +97,11 @@ struct minix3_super_block {
struct minix_dir_entry {
__u16 inode;
char name[0];
char name[];
};
struct minix3_dir_entry {
__u32 inode;
char name[0];
char name[];
};
#endif
......@@ -58,7 +58,7 @@ struct mmc_ioc_cmd {
*/
struct mmc_ioc_multi_cmd {
__u64 num_of_cmds;
struct mmc_ioc_cmd cmds[0];
struct mmc_ioc_cmd cmds[];
};
#define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
......
......@@ -30,25 +30,25 @@ struct nd_cmd_get_config_data_hdr {
__u32 in_offset;
__u32 in_length;
__u32 status;
__u8 out_buf[0];
__u8 out_buf[];
} __packed;
struct nd_cmd_set_config_hdr {
__u32 in_offset;
__u32 in_length;
__u8 in_buf[0];
__u8 in_buf[];
} __packed;
struct nd_cmd_vendor_hdr {
__u32 opcode;
__u32 in_length;
__u8 in_buf[0];
__u8 in_buf[];
} __packed;
struct nd_cmd_vendor_tail {
__u32 status;
__u32 out_length;
__u8 out_buf[0];
__u8 out_buf[];
} __packed;
struct nd_cmd_ars_cap {
......@@ -86,7 +86,7 @@ struct nd_cmd_ars_status {
__u32 reserved;
__u64 err_address;
__u64 length;
} __packed records[0];
} __packed records[];
} __packed;
struct nd_cmd_clear_error {
......
......@@ -29,12 +29,12 @@ struct net_dm_config_entry {
struct net_dm_config_msg {
__u32 entries;
struct net_dm_config_entry options[0];
struct net_dm_config_entry options[];
};
struct net_dm_alert_msg {
__u32 entries;
struct net_dm_drop_point points[0];
struct net_dm_drop_point points[];
};
struct net_dm_user_msg {
......
......@@ -28,7 +28,7 @@ struct xt_entry_match {
__u16 match_size;
} u;
unsigned char data[0];
unsigned char data[];
};
struct xt_entry_target {
......@@ -119,7 +119,7 @@ struct xt_counters_info {
unsigned int num_counters;
/* The counters (actually `number' of these). */
struct xt_counters counters[0];
struct xt_counters counters[];
};
#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
......
......@@ -109,7 +109,7 @@ struct arpt_entry
struct xt_counters counters;
/* The matches (if any), then the target. */
unsigned char elems[0];
unsigned char elems[];
};
/*
......@@ -181,7 +181,7 @@ struct arpt_replace {
struct xt_counters __user *counters;
/* The entries (hang off end: not really an array). */
struct arpt_entry entries[0];
struct arpt_entry entries[];
};
/* The argument to ARPT_SO_GET_ENTRIES. */
......@@ -193,7 +193,7 @@ struct arpt_get_entries {
unsigned int size;
/* The entries. */
struct arpt_entry entrytable[0];
struct arpt_entry entrytable[];
};
/* Helper functions */
......
......@@ -40,7 +40,7 @@ struct ebt_mac_wormhash_tuple {
struct ebt_mac_wormhash {
int table[257];
int poolsize;
struct ebt_mac_wormhash_tuple pool[0];
struct ebt_mac_wormhash_tuple pool[];
};
#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
......
......@@ -121,7 +121,7 @@ struct ipt_entry {
struct xt_counters counters;
/* The matches (if any), then the target. */
unsigned char elems[0];
unsigned char elems[];
};
/*
......@@ -203,7 +203,7 @@ struct ipt_replace {
struct xt_counters __user *counters;
/* The entries (hang off end: not really an array). */
struct ipt_entry entries[0];
struct ipt_entry entries[];
};
/* The argument to IPT_SO_GET_ENTRIES. */
......@@ -215,7 +215,7 @@ struct ipt_get_entries {
unsigned int size;
/* The entries. */
struct ipt_entry entrytable[0];
struct ipt_entry entrytable[];
};
/* Helper functions */
......
......@@ -243,7 +243,7 @@ struct ip6t_replace {
struct xt_counters __user *counters;
/* The entries (hang off end: not really an array). */
struct ip6t_entry entries[0];
struct ip6t_entry entries[];
};
/* The argument to IP6T_SO_GET_ENTRIES. */
......@@ -255,7 +255,7 @@ struct ip6t_get_entries {
unsigned int size;
/* The entries. */
struct ip6t_entry entrytable[0];
struct ip6t_entry entrytable[];
};
/* Helper functions */
......
......@@ -491,7 +491,7 @@ struct perf_event_query_bpf {
/*
* User provided buffer to store program ids
*/
__u32 ids[0];
__u32 ids[];
};
/*
......
......@@ -256,7 +256,7 @@ struct tc_u32_sel {
short hoff;
__be32 hmask;
struct tc_u32_key keys[0];
struct tc_u32_key keys[];
};
struct tc_u32_mark {
......@@ -268,7 +268,7 @@ struct tc_u32_mark {
struct tc_u32_pcnt {
__u64 rcnt;
__u64 rhit;
__u64 kcnts[0];
__u64 kcnts[];
};
/* Flags */
......
......@@ -303,7 +303,7 @@ struct mdp_superblock_1 {
* into the 'roles' value. If a device is spare or faulty, then it doesn't
* have a meaningful role.
*/
__le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
__le16 dev_roles[]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
};
/* feature_map bits */
......
......@@ -41,7 +41,7 @@
struct rand_pool_info {
int entropy_count;
int buf_size;
__u32 buf[0];
__u32 buf[];
};
/*
......
......@@ -27,7 +27,7 @@ struct romfs_super_block {
__be32 word1;
__be32 size;
__be32 checksum;
char name[0]; /* volume name */
char name[]; /* volume name */
};
/* On disk inode */
......@@ -37,7 +37,7 @@ struct romfs_inode {
__be32 spec;
__be32 size;
__be32 checksum;
char name[0];
char name[];
};
#define ROMFH_TYPE 7
......
......@@ -440,7 +440,7 @@ struct rtnexthop {
/* RTA_VIA */
struct rtvia {
__kernel_sa_family_t rtvia_family;
__u8 rtvia_addr[0];
__u8 rtvia_addr[];
};
/* RTM_CACHEINFO */
......
......@@ -365,7 +365,7 @@ struct sctp_assoc_change {
__u16 sac_outbound_streams;
__u16 sac_inbound_streams;
sctp_assoc_t sac_assoc_id;
__u8 sac_info[0];
__u8 sac_info[];
};
/*
......@@ -436,7 +436,7 @@ struct sctp_remote_error {
__u32 sre_length;
__be16 sre_error;
sctp_assoc_t sre_assoc_id;
__u8 sre_data[0];
__u8 sre_data[];
};
......@@ -453,7 +453,7 @@ struct sctp_send_failed {
__u32 ssf_error;
struct sctp_sndrcvinfo ssf_info;
sctp_assoc_t ssf_assoc_id;
__u8 ssf_data[0];
__u8 ssf_data[];
};
struct sctp_send_failed_event {
......@@ -463,7 +463,7 @@ struct sctp_send_failed_event {
__u32 ssf_error;
struct sctp_sndinfo ssfe_info;
sctp_assoc_t ssf_assoc_id;
__u8 ssf_data[0];
__u8 ssf_data[];
};
/*
......@@ -1029,7 +1029,7 @@ struct sctp_getaddrs_old {
struct sctp_getaddrs {
sctp_assoc_t assoc_id; /*input*/
__u32 addr_num; /*output*/
__u8 addrs[0]; /*output, variable size*/
__u8 addrs[]; /*output, variable size*/
};
/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
......
......@@ -30,7 +30,7 @@ struct ipv6_sr_hdr {
__u8 flags;
__u16 tag;
struct in6_addr segments[0];
struct in6_addr segments[];
};
#define SR6_FLAG1_PROTECTED (1 << 6)
......
......@@ -26,7 +26,7 @@ enum {
struct seg6_iptunnel_encap {
int mode;
struct ipv6_sr_hdr srh[0];
struct ipv6_sr_hdr srh[];
};
#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
......
......@@ -36,7 +36,7 @@ struct stp_policy_id {
/* padding */
__u16 __reserved_0;
__u32 __reserved_1;
char id[0];
char id[];
};
#define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)
......
......@@ -152,7 +152,7 @@ struct tcmu_tmr_entry {
__u32 cmd_cnt;
__u64 __pad3;
__u64 __pad4;
__u16 cmd_ids[0];
__u16 cmd_ids[];
} __packed;
#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
......
......@@ -341,7 +341,7 @@ struct uac_feature_unit_descriptor {
__u8 bUnitID;
__u8 bSourceID;
__u8 bControlSize;
__u8 bmaControls[0]; /* variable length */
__u8 bmaControls[]; /* variable length */
} __attribute__((packed));
static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
......
......@@ -171,7 +171,7 @@ struct usb_cdc_mdlm_detail_desc {
/* type is associated with mdlm_desc.bGUID */
__u8 bGuidDescriptorType;
__u8 bDetailData[0];
__u8 bDetailData[];
} __attribute__ ((packed));
/* "OBEX Control Model Functional Descriptor" */
......@@ -379,7 +379,7 @@ struct usb_cdc_ncm_ndp16 {
__le32 dwSignature;
__le16 wLength;
__le16 wNextNdpIndex;
struct usb_cdc_ncm_dpe16 dpe16[0];
struct usb_cdc_ncm_dpe16 dpe16[];
} __attribute__ ((packed));
/* 32-bit NCM Datagram Pointer Entry */
......@@ -395,7 +395,7 @@ struct usb_cdc_ncm_ndp32 {
__le16 wReserved6;
__le32 dwNextNdpIndex;
__le32 dwReserved12;
struct usb_cdc_ncm_dpe32 dpe32[0];
struct usb_cdc_ncm_dpe32 dpe32[];
} __attribute__ ((packed));
/* CDC NCM subclass 3.2.1 and 3.2.2 */
......
......@@ -818,7 +818,7 @@ struct usb_key_descriptor {
__u8 tTKID[3];
__u8 bReserved;
__u8 bKeyData[0];
__u8 bKeyData[];
} __attribute__((packed));
/*-------------------------------------------------------------------------*/
......
......@@ -60,7 +60,7 @@ enum usb_raw_event_type {
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[0];
__u8 data[];
};
#define USB_RAW_IO_FLAGS_ZERO 0x0001
......@@ -90,7 +90,7 @@ struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[0];
__u8 data[];
};
/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
......
......@@ -131,7 +131,7 @@ struct usbdevfs_urb {
unsigned int signr; /* signal to be sent on completion,
or 0 if none should be sent. */
void __user *usercontext;
struct usbdevfs_iso_packet_desc iso_frame_desc[0];
struct usbdevfs_iso_packet_desc iso_frame_desc[];
};
/* ioctls for talking directly to drivers */
......@@ -176,7 +176,7 @@ struct usbdevfs_disconnect_claim {
struct usbdevfs_streams {
unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */
unsigned int num_eps;
unsigned char eps[0];
unsigned char eps[];
};
/*
......
......@@ -107,7 +107,7 @@ struct vhost_memory_region {
struct vhost_memory {
__u32 nregions;
__u32 padding;
struct vhost_memory_region regions[0];
struct vhost_memory_region regions[];
};
/* VHOST_SCSI specific definitions */
......@@ -135,7 +135,7 @@ struct vhost_scsi_target {
struct vhost_vdpa_config {
__u32 off;
__u32 len;
__u8 buf[0];
__u8 buf[];
};
/* vhost vdpa IOVA range
......
......@@ -38,7 +38,7 @@ struct virtio_9p_config {
/* length of the tag name */
__virtio16 tag_len;
/* non-NULL terminated tag name */
__u8 tag[0];
__u8 tag[];
} __attribute__((packed));
#endif /* _LINUX_VIRTIO_9P_H */
......@@ -33,7 +33,7 @@ struct xfrm_sec_ctx {
__u8 ctx_alg;
__u16 ctx_len;
__u32 ctx_sid;
char ctx_str[0];
char ctx_str[];
};
/* Security Context Domains of Interpretation */
......@@ -96,27 +96,27 @@ struct xfrm_replay_state_esn {
__u32 oseq_hi;
__u32 seq_hi;
__u32 replay_window;
__u32 bmp[0];
__u32 bmp[];
};
struct xfrm_algo {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
char alg_key[0];
char alg_key[];
};
struct xfrm_algo_auth {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
unsigned int alg_trunc_len; /* in bits */
char alg_key[0];
char alg_key[];
};
struct xfrm_algo_aead {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
unsigned int alg_icv_len; /* in bits */
char alg_key[0];
char alg_key[];
};
struct xfrm_stats {
......
......@@ -180,7 +180,7 @@ struct hfi1_sdma_comp_entry {
struct hfi1_status {
__aligned_u64 dev; /* device/hw status bits */
__aligned_u64 port; /* port state and status bits */
char freezemsg[0];
char freezemsg[];
};
enum sdma_req_opcode {
......
......@@ -158,18 +158,18 @@ struct ib_uverbs_ex_cmd_hdr {
struct ib_uverbs_get_context {
__aligned_u64 response;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_get_context_resp {
__u32 async_fd;
__u32 num_comp_vectors;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_device {
__aligned_u64 response;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_device_resp {
......@@ -278,7 +278,7 @@ struct ib_uverbs_query_port {
__aligned_u64 response;
__u8 port_num;
__u8 reserved[7];
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_port_resp {
......@@ -308,12 +308,12 @@ struct ib_uverbs_query_port_resp {
struct ib_uverbs_alloc_pd {
__aligned_u64 response;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_alloc_pd_resp {
__u32 pd_handle;
__u32 driver_data[0];
__u32 driver_data[];
};
struct ib_uverbs_dealloc_pd {
......@@ -324,12 +324,12 @@ struct ib_uverbs_open_xrcd {
__aligned_u64 response;
__u32 fd;
__u32 oflags;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_open_xrcd_resp {
__u32 xrcd_handle;
__u32 driver_data[0];
__u32 driver_data[];
};
struct ib_uverbs_close_xrcd {
......@@ -343,14 +343,14 @@ struct ib_uverbs_reg_mr {
__aligned_u64 hca_va;
__u32 pd_handle;
__u32 access_flags;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_reg_mr_resp {
__u32 mr_handle;
__u32 lkey;
__u32 rkey;
__u32 driver_data[0];
__u32 driver_data[];
};
struct ib_uverbs_rereg_mr {
......@@ -362,13 +362,13 @@ struct ib_uverbs_rereg_mr {
__aligned_u64 hca_va;
__u32 pd_handle;
__u32 access_flags;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_rereg_mr_resp {
__u32 lkey;
__u32 rkey;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_dereg_mr {
......@@ -380,13 +380,13 @@ struct ib_uverbs_alloc_mw {
__u32 pd_handle;
__u8 mw_type;
__u8 reserved[3];
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_alloc_mw_resp {
__u32 mw_handle;
__u32 rkey;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_dealloc_mw {
......@@ -408,7 +408,7 @@ struct ib_uverbs_create_cq {
__u32 comp_vector;
__s32 comp_channel;
__u32 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
enum ib_uverbs_ex_create_cq_flags {
......@@ -442,13 +442,13 @@ struct ib_uverbs_resize_cq {
__aligned_u64 response;
__u32 cq_handle;
__u32 cqe;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_resize_cq_resp {
__u32 cqe;
__u32 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_poll_cq {
......@@ -492,7 +492,7 @@ struct ib_uverbs_wc {
struct ib_uverbs_poll_cq_resp {
__u32 count;
__u32 reserved;
struct ib_uverbs_wc wc[0];
struct ib_uverbs_wc wc[];
};
struct ib_uverbs_req_notify_cq {
......@@ -585,7 +585,7 @@ struct ib_uverbs_create_qp {
__u8 qp_type;
__u8 is_srq;
__u8 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
enum ib_uverbs_create_qp_mask {
......@@ -624,7 +624,7 @@ struct ib_uverbs_open_qp {
__u32 qpn;
__u8 qp_type;
__u8 reserved[7];
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
/* also used for open response */
......@@ -669,7 +669,7 @@ struct ib_uverbs_query_qp {
__aligned_u64 response;
__u32 qp_handle;
__u32 attr_mask;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_qp_resp {
......@@ -703,7 +703,7 @@ struct ib_uverbs_query_qp_resp {
__u8 alt_timeout;
__u8 sq_sig_all;
__u8 reserved[5];
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_modify_qp {
......@@ -824,7 +824,7 @@ struct ib_uverbs_post_send {
__u32 wr_count;
__u32 sge_count;
__u32 wqe_size;
struct ib_uverbs_send_wr send_wr[0];
struct ib_uverbs_send_wr send_wr[];
};
struct ib_uverbs_post_send_resp {
......@@ -843,7 +843,7 @@ struct ib_uverbs_post_recv {
__u32 wr_count;
__u32 sge_count;
__u32 wqe_size;
struct ib_uverbs_recv_wr recv_wr[0];
struct ib_uverbs_recv_wr recv_wr[];
};
struct ib_uverbs_post_recv_resp {
......@@ -856,7 +856,7 @@ struct ib_uverbs_post_srq_recv {
__u32 wr_count;
__u32 sge_count;
__u32 wqe_size;
struct ib_uverbs_recv_wr recv[0];
struct ib_uverbs_recv_wr recv[];
};
struct ib_uverbs_post_srq_recv_resp {
......@@ -869,12 +869,12 @@ struct ib_uverbs_create_ah {
__u32 pd_handle;
__u32 reserved;
struct ib_uverbs_ah_attr attr;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_create_ah_resp {
__u32 ah_handle;
__u32 driver_data[0];
__u32 driver_data[];
};
struct ib_uverbs_destroy_ah {
......@@ -886,7 +886,7 @@ struct ib_uverbs_attach_mcast {
__u32 qp_handle;
__u16 mlid;
__u16 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_detach_mcast {
......@@ -894,7 +894,7 @@ struct ib_uverbs_detach_mcast {
__u32 qp_handle;
__u16 mlid;
__u16 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_flow_spec_hdr {
......@@ -1135,7 +1135,7 @@ struct ib_uverbs_flow_attr {
* struct ib_flow_spec_xxx
* struct ib_flow_spec_yyy
*/
struct ib_uverbs_flow_spec_hdr flow_specs[0];
struct ib_uverbs_flow_spec_hdr flow_specs[];
};
struct ib_uverbs_create_flow {
......@@ -1161,7 +1161,7 @@ struct ib_uverbs_create_srq {
__u32 max_wr;
__u32 max_sge;
__u32 srq_limit;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_create_xsrq {
......@@ -1175,7 +1175,7 @@ struct ib_uverbs_create_xsrq {
__u32 max_num_tags;
__u32 xrcd_handle;
__u32 cq_handle;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_create_srq_resp {
......@@ -1183,7 +1183,7 @@ struct ib_uverbs_create_srq_resp {
__u32 max_wr;
__u32 max_sge;
__u32 srqn;
__u32 driver_data[0];
__u32 driver_data[];
};
struct ib_uverbs_modify_srq {
......@@ -1191,14 +1191,14 @@ struct ib_uverbs_modify_srq {
__u32 attr_mask;
__u32 max_wr;
__u32 srq_limit;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_srq {
__aligned_u64 response;
__u32 srq_handle;
__u32 reserved;
__aligned_u64 driver_data[0];
__aligned_u64 driver_data[];
};
struct ib_uverbs_query_srq_resp {
......@@ -1269,7 +1269,7 @@ struct ib_uverbs_ex_create_rwq_ind_table {
* wq_handle1
* wq_handle2
*/
__u32 wq_handles[0];
__u32 wq_handles[];
};
struct ib_uverbs_ex_create_rwq_ind_table_resp {
......
......@@ -184,7 +184,7 @@ struct rdma_ucm_query_addr_resp {
struct rdma_ucm_query_path_resp {
__u32 num_paths;
__u32 reserved;
struct ib_path_rec_data path_data[0];
struct ib_path_rec_data path_data[];
};
struct rdma_ucm_conn_param {
......
......@@ -81,7 +81,7 @@ struct ib_uverbs_ioctl_hdr {
__aligned_u64 reserved1;
__u32 driver_id;
__u32 reserved2;
struct ib_uverbs_attr attrs[0];
struct ib_uverbs_attr attrs[];
};
#endif
......@@ -264,7 +264,7 @@ struct fc_tlv_desc {
* Size of descriptor excluding
* desc_tag and desc_len fields.
*/
__u8 desc_value[0]; /* Descriptor Value */
__u8 desc_value[]; /* Descriptor Value */
};
/* Descriptor tag and len fields are considered the mandatory header
......@@ -1027,7 +1027,7 @@ struct fc_fn_li_desc {
* threshold to caause the LI event
*/
__be32 pname_count; /* number of portname_list elements */
__be64 pname_list[0]; /* list of N_Port_Names accessible
__be64 pname_list[]; /* list of N_Port_Names accessible
* through the attached port
*/
};
......@@ -1069,7 +1069,7 @@ struct fc_fn_peer_congn_desc {
* congestion event
*/
__be32 pname_count; /* number of portname_list elements */
__be64 pname_list[0]; /* list of N_Port_Names accessible
__be64 pname_list[]; /* list of N_Port_Names accessible
* through the attached port
*/
};
......@@ -1104,7 +1104,7 @@ struct fc_els_fpin {
* Size of ELS excluding fpin_cmd,
* fpin_zero and desc_len fields.
*/
struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */
struct fc_tlv_desc fpin_desc[]; /* Descriptor list */
};
/* Diagnostic Function Descriptor - FPIN Registration */
......@@ -1115,7 +1115,7 @@ struct fc_df_desc_fpin_reg {
* desc_tag and desc_len fields.
*/
__be32 count; /* Number of desc_tags elements */
__be32 desc_tags[0]; /* Array of Descriptor Tags.
__be32 desc_tags[]; /* Array of Descriptor Tags.
* Each tag indicates a function
* supported by the N_Port (request)
* or by the N_Port and Fabric
......@@ -1135,7 +1135,7 @@ struct fc_els_rdf {
* Size of ELS excluding fpin_cmd,
* fpin_zero and desc_len fields.
*/
struct fc_tlv_desc desc[0]; /* Descriptor list */
struct fc_tlv_desc desc[]; /* Descriptor list */
};
/*
......@@ -1148,7 +1148,7 @@ struct fc_els_rdf_resp {
* and desc_list_len fields.
*/
struct fc_els_lsri_desc lsri;
struct fc_tlv_desc desc[0]; /* Supported Descriptor list */
struct fc_tlv_desc desc[]; /* Supported Descriptor list */
};
......@@ -1231,7 +1231,7 @@ struct fc_els_edc {
* Size of ELS excluding edc_cmd,
* edc_zero and desc_len fields.
*/
struct fc_tlv_desc desc[0];
struct fc_tlv_desc desc[];
/* Diagnostic Descriptor list */
};
......@@ -1245,7 +1245,7 @@ struct fc_els_edc_resp {
* and desc_list_len fields.
*/
struct fc_els_lsri_desc lsri;
struct fc_tlv_desc desc[0];
struct fc_tlv_desc desc[];
/* Supported Diagnostic Descriptor list */
};
......
......@@ -209,7 +209,7 @@ struct fc_bsg_host_vendor {
__u64 vendor_id;
/* start of vendor command area */
__u32 vendor_cmd[0];
__u32 vendor_cmd[];
};
/* Response:
......
......@@ -1106,7 +1106,7 @@ struct snd_ctl_elem_value {
struct snd_ctl_tlv {
unsigned int numid; /* control element numeric identification */
unsigned int length; /* in bytes aligned to 4 */
unsigned int tlv[0]; /* first TLV */
unsigned int tlv[]; /* first TLV */
};
#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
......
......@@ -38,11 +38,11 @@ struct snd_efw_transaction {
__be32 category;
__be32 command;
__be32 status;
__be32 params[0];
__be32 params[];
};
struct snd_firewire_event_efw_response {
unsigned int type;
__be32 response[0]; /* some responses */
__be32 response[]; /* some responses */
};
struct snd_firewire_event_digi00x_message {
......@@ -63,7 +63,7 @@ struct snd_firewire_tascam_change {
struct snd_firewire_event_tascam_control {
unsigned int type;
struct snd_firewire_tascam_change changes[0];
struct snd_firewire_tascam_change changes[];
};
struct snd_firewire_event_motu_register_dsp_change {
......
......@@ -151,7 +151,7 @@ struct skl_dfw_algo_data {
__u32 rsvd:30;
__u32 param_id;
__u32 max;
char params[0];
char params[];
} __packed;
enum skl_tkn_dir {
......
......@@ -23,7 +23,7 @@ struct sof_abi_hdr {
__u32 size; /**< size in bytes of data excl. this struct */
__u32 abi; /**< SOF ABI version */
__u32 reserved[4]; /**< reserved for future use */
__u32 data[0]; /**< Component data - opaque to core */
__u32 data[]; /**< Component data - opaque to core */
} __packed;
#endif
......@@ -61,7 +61,7 @@ struct usb_stream {
unsigned inpacket_split_at;
unsigned next_inpacket_split;
unsigned next_inpacket_split_at;
struct usb_stream_packet inpacket[0];
struct usb_stream_packet inpacket[];
};
enum usb_stream_state {
......
......@@ -198,13 +198,13 @@ struct kvm_msrs {
__u32 nmsrs; /* number of msrs in entries */
__u32 pad;
struct kvm_msr_entry entries[0];
struct kvm_msr_entry entries[];
};
/* for KVM_GET_MSR_INDEX_LIST */
struct kvm_msr_list {
__u32 nmsrs; /* number of msrs in entries */
__u32 indices[0];
__u32 indices[];
};
/* Maximum size of any access bitmap in bytes */
......@@ -241,7 +241,7 @@ struct kvm_cpuid_entry {
struct kvm_cpuid {
__u32 nent;
__u32 padding;
struct kvm_cpuid_entry entries[0];
struct kvm_cpuid_entry entries[];
};
struct kvm_cpuid_entry2 {
......@@ -263,7 +263,7 @@ struct kvm_cpuid_entry2 {
struct kvm_cpuid2 {
__u32 nent;
__u32 padding;
struct kvm_cpuid_entry2 entries[0];
struct kvm_cpuid_entry2 entries[];
};
/* for KVM_GET_PIT and KVM_SET_PIT */
......@@ -389,7 +389,7 @@ struct kvm_xsave {
* the contents of CPUID leaf 0xD on the host.
*/
__u32 region[1024];
__u32 extra[0];
__u32 extra[];
};
#define KVM_MAX_XCRS 16
......@@ -515,7 +515,7 @@ struct kvm_pmu_event_filter {
__u32 fixed_counter_bitmap;
__u32 flags;
__u32 pad[4];
__u64 events[0];
__u64 events[];
};
#define KVM_PMU_EVENT_ALLOW 0
......
......@@ -2060,7 +2060,7 @@ struct i915_context_engines_load_balance {
__u64 mbz64; /* reserved for future use; must be zero */
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __attribute__((packed));
#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
......@@ -2098,7 +2098,7 @@ struct i915_context_engines_bond {
__u64 flags; /* all undefined flags must be zero */
__u64 mbz64[4]; /* reserved for future use; must be zero */
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __attribute__((packed));
#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
......@@ -2225,7 +2225,7 @@ struct i915_context_engines_parallel_submit {
* length = width (i) * num_siblings (j)
* index = j + i * num_siblings
*/
struct i915_engine_class_instance engines[0];
struct i915_engine_class_instance engines[];
} __packed;
......
......@@ -90,7 +90,7 @@ struct file_dedupe_range {
__u16 dest_count; /* in - total elements in info array */
__u16 reserved1; /* must be zero */
__u32 reserved2; /* must be zero */
struct file_dedupe_range_info info[0];
struct file_dedupe_range_info info[];
};
/* And dynamically-tunable limits and defaults: */
......
......@@ -108,7 +108,7 @@ struct tun_pi {
struct tun_filter {
__u16 flags; /* TUN_FLT_ flags see above */
__u16 count; /* Number of addresses */
__u8 addr[0][ETH_ALEN];
__u8 addr[][ETH_ALEN];
};
#endif /* _UAPI__IF_TUN_H */
......@@ -539,7 +539,7 @@ struct kvm_coalesced_mmio {
struct kvm_coalesced_mmio_ring {
__u32 first, last;
struct kvm_coalesced_mmio coalesced_mmio[0];
struct kvm_coalesced_mmio coalesced_mmio[];
};
#define KVM_COALESCED_MMIO_MAX \
......@@ -618,7 +618,7 @@ struct kvm_clear_dirty_log {
/* for KVM_SET_SIGNAL_MASK */
struct kvm_signal_mask {
__u32 len;
__u8 sigset[0];
__u8 sigset[];
};
/* for KVM_TPR_ACCESS_REPORTING */
......@@ -1216,7 +1216,7 @@ struct kvm_irq_routing_entry {
struct kvm_irq_routing {
__u32 nr;
__u32 flags;
struct kvm_irq_routing_entry entries[0];
struct kvm_irq_routing_entry entries[];
};
#endif
......@@ -1335,7 +1335,7 @@ struct kvm_dirty_tlb {
struct kvm_reg_list {
__u64 n; /* number of regs */
__u64 reg[0];
__u64 reg[];
};
struct kvm_one_reg {
......
......@@ -491,7 +491,7 @@ struct perf_event_query_bpf {
/*
* User provided buffer to store program ids
*/
__u32 ids[0];
__u32 ids[];
};
/*
......
......@@ -180,7 +180,7 @@ struct tc_u32_sel {
short hoff;
__be32 hmask;
struct tc_u32_key keys[0];
struct tc_u32_key keys[];
};
struct tc_u32_mark {
......@@ -192,7 +192,7 @@ struct tc_u32_mark {
struct tc_u32_pcnt {
__u64 rcnt;
__u64 rhit;
__u64 kcnts[0];
__u64 kcnts[];
};
/* Flags */
......
......@@ -30,7 +30,7 @@ struct ipv6_sr_hdr {
__u8 flags;
__u16 tag;
struct in6_addr segments[0];
struct in6_addr segments[];
};
#define SR6_FLAG1_PROTECTED (1 << 6)
......@@ -49,7 +49,7 @@ struct ipv6_sr_hdr {
struct sr6_tlv {
__u8 type;
__u8 len;
__u8 data[0];
__u8 data[];
};
#endif
......@@ -131,7 +131,7 @@ struct usbdevfs_urb {
unsigned int signr; /* signal to be sent on completion,
or 0 if none should be sent. */
void __user *usercontext;
struct usbdevfs_iso_packet_desc iso_frame_desc[0];
struct usbdevfs_iso_packet_desc iso_frame_desc[];
};
/* ioctls for talking directly to drivers */
......@@ -176,7 +176,7 @@ struct usbdevfs_disconnect_claim {
struct usbdevfs_streams {
unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */
unsigned int num_eps;
unsigned char eps[0];
unsigned char eps[];
};
/*
......
......@@ -1106,7 +1106,7 @@ struct snd_ctl_elem_value {
struct snd_ctl_tlv {
unsigned int numid; /* control element numeric identification */
unsigned int length; /* in bytes aligned to 4 */
unsigned int tlv[0]; /* first TLV */
unsigned int tlv[]; /* first TLV */
};
#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment