Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/78
Build-tested-by: kernel 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: Gustavo A. R. Silva <gustavoars@kernel.org>

+216 -216
+2 -2
arch/m68k/include/uapi/asm/bootinfo.h
··· 34 34 struct bi_record { 35 35 __be16 tag; /* tag ID */ 36 36 __be16 size; /* size of record (in bytes) */ 37 - __be32 data[0]; /* data */ 37 + __be32 data[]; /* data */ 38 38 }; 39 39 40 40 ··· 168 168 struct { 169 169 __be32 machtype; 170 170 __be32 version; 171 - } machversions[0]; 171 + } machversions[]; 172 172 } __packed; 173 173 174 174 #endif /* __ASSEMBLY__ */
+1 -1
arch/mips/include/uapi/asm/ucontext.h
··· 60 60 sigset_t uc_sigmask; 61 61 62 62 /* Extended context structures may follow ucontext */ 63 - unsigned long long uc_extcontext[0]; 63 + unsigned long long uc_extcontext[]; 64 64 }; 65 65 66 66 #endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
+3 -3
arch/s390/include/uapi/asm/hwctrset.h
··· 30 30 struct s390_ctrset_setdata { /* Counter set data */ 31 31 __u32 set; /* Counter set number */ 32 32 __u32 no_cnts; /* # of counters stored in cv[] */ 33 - __u64 cv[0]; /* Counter values (variable length) */ 33 + __u64 cv[]; /* Counter values (variable length) */ 34 34 }; 35 35 36 36 struct s390_ctrset_cpudata { /* Counter set data per CPU */ 37 37 __u32 cpu_nr; /* CPU number */ 38 38 __u32 no_sets; /* # of counters sets in data[] */ 39 - struct s390_ctrset_setdata data[0]; 39 + struct s390_ctrset_setdata data[]; 40 40 }; 41 41 42 42 struct s390_ctrset_read { /* Structure to get all ctr sets */ 43 43 __u64 no_cpus; /* Total # of CPUs data taken from */ 44 - struct s390_ctrset_cpudata data[0]; 44 + struct s390_ctrset_cpudata data[]; 45 45 }; 46 46 47 47 #define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
+1 -1
arch/x86/include/uapi/asm/bootparam.h
··· 52 52 __u64 next; 53 53 __u32 type; 54 54 __u32 len; 55 - __u8 data[0]; 55 + __u8 data[]; 56 56 }; 57 57 58 58 /* extensible setup indirect data node */
+6 -6
arch/x86/include/uapi/asm/kvm.h
··· 198 198 __u32 nmsrs; /* number of msrs in entries */ 199 199 __u32 pad; 200 200 201 - struct kvm_msr_entry entries[0]; 201 + struct kvm_msr_entry entries[]; 202 202 }; 203 203 204 204 /* for KVM_GET_MSR_INDEX_LIST */ 205 205 struct kvm_msr_list { 206 206 __u32 nmsrs; /* number of msrs in entries */ 207 - __u32 indices[0]; 207 + __u32 indices[]; 208 208 }; 209 209 210 210 /* Maximum size of any access bitmap in bytes */ ··· 241 241 struct kvm_cpuid { 242 242 __u32 nent; 243 243 __u32 padding; 244 - struct kvm_cpuid_entry entries[0]; 244 + struct kvm_cpuid_entry entries[]; 245 245 }; 246 246 247 247 struct kvm_cpuid_entry2 { ··· 263 263 struct kvm_cpuid2 { 264 264 __u32 nent; 265 265 __u32 padding; 266 - struct kvm_cpuid_entry2 entries[0]; 266 + struct kvm_cpuid_entry2 entries[]; 267 267 }; 268 268 269 269 /* for KVM_GET_PIT and KVM_SET_PIT */ ··· 389 389 * the contents of CPUID leaf 0xD on the host. 390 390 */ 391 391 __u32 region[1024]; 392 - __u32 extra[0]; 392 + __u32 extra[]; 393 393 }; 394 394 395 395 #define KVM_MAX_XCRS 16 ··· 516 516 __u32 fixed_counter_bitmap; 517 517 __u32 flags; 518 518 __u32 pad[4]; 519 - __u64 events[0]; 519 + __u64 events[]; 520 520 }; 521 521 522 522 #define KVM_PMU_EVENT_ALLOW 0
+3 -3
include/uapi/drm/i915_drm.h
··· 2123 2123 2124 2124 __u64 mbz64; /* reserved for future use; must be zero */ 2125 2125 2126 - struct i915_engine_class_instance engines[0]; 2126 + struct i915_engine_class_instance engines[]; 2127 2127 } __attribute__((packed)); 2128 2128 2129 2129 #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \ ··· 2161 2161 __u64 flags; /* all undefined flags must be zero */ 2162 2162 __u64 mbz64[4]; /* reserved for future use; must be zero */ 2163 2163 2164 - struct i915_engine_class_instance engines[0]; 2164 + struct i915_engine_class_instance engines[]; 2165 2165 } __attribute__((packed)); 2166 2166 2167 2167 #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \ ··· 2288 2288 * length = width (i) * num_siblings (j) 2289 2289 * index = j + i * num_siblings 2290 2290 */ 2291 - struct i915_engine_class_instance engines[0]; 2291 + struct i915_engine_class_instance engines[]; 2292 2292 2293 2293 } __packed; 2294 2294
+1 -1
include/uapi/linux/blkzoned.h
··· 130 130 __u64 sector; 131 131 __u32 nr_zones; 132 132 __u32 flags; 133 - struct blk_zone zones[0]; 133 + struct blk_zone zones[]; 134 134 }; 135 135 136 136 /**
+1 -1
include/uapi/linux/bpf.h
··· 79 79 /* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */ 80 80 struct bpf_lpm_trie_key { 81 81 __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */ 82 - __u8 data[0]; /* Arbitrary size */ 82 + __u8 data[]; /* Arbitrary size */ 83 83 }; 84 84 85 85 struct bpf_cgroup_storage_key {
+5 -5
include/uapi/linux/btrfs.h
··· 93 93 __u64 num_ref_copies; 94 94 __u64 num_excl_copies; 95 95 struct btrfs_qgroup_limit lim; 96 - __u64 qgroups[0]; 96 + __u64 qgroups[]; 97 97 }; 98 98 99 99 struct btrfs_ioctl_qgroup_limit_args { ··· 561 561 __u64 buf_size; /* in - size of buffer 562 562 * out - on EOVERFLOW: needed size 563 563 * to store item */ 564 - __u64 buf[0]; /* out - found items */ 564 + __u64 buf[]; /* out - found items */ 565 565 }; 566 566 567 567 struct btrfs_ioctl_clone_range_args { ··· 632 632 __u16 dest_count; /* in - total elements in info array */ 633 633 __u16 reserved1; 634 634 __u32 reserved2; 635 - struct btrfs_ioctl_same_extent_info info[0]; 635 + struct btrfs_ioctl_same_extent_info info[]; 636 636 }; 637 637 638 638 struct btrfs_ioctl_space_info { ··· 644 644 struct btrfs_ioctl_space_args { 645 645 __u64 space_slots; 646 646 __u64 total_spaces; 647 - struct btrfs_ioctl_space_info spaces[0]; 647 + struct btrfs_ioctl_space_info spaces[]; 648 648 }; 649 649 650 650 struct btrfs_data_container { ··· 652 652 __u32 bytes_missing; /* out -- additional bytes needed for result */ 653 653 __u32 elem_cnt; /* out */ 654 654 __u32 elem_missed; /* out */ 655 - __u64 val[0]; /* out */ 655 + __u64 val[]; /* out */ 656 656 }; 657 657 658 658 struct btrfs_ioctl_ino_path_args {
+1 -1
include/uapi/linux/btrfs_tree.h
··· 575 575 __le64 parent_objectid; 576 576 __le64 index; 577 577 __le16 name_len; 578 - __u8 name[0]; 578 + __u8 name[]; 579 579 /* name goes here */ 580 580 } __attribute__ ((__packed__)); 581 581
+1 -1
include/uapi/linux/can/bcm.h
··· 71 71 struct bcm_timeval ival1, ival2; 72 72 canid_t can_id; 73 73 __u32 nframes; 74 - struct can_frame frames[0]; 74 + struct can_frame frames[]; 75 75 }; 76 76 77 77 enum {
+1 -1
include/uapi/linux/connector.h
··· 75 75 76 76 __u16 len; /* Length of the following data */ 77 77 __u16 flags; 78 - __u8 data[0]; 78 + __u8 data[]; 79 79 }; 80 80 81 81 #endif /* _UAPI__CONNECTOR_H */
+1 -1
include/uapi/linux/cycx_cfm.h
··· 91 91 unsigned short reserved[6]; 92 92 char descr[CFM_DESCR_LEN]; 93 93 struct cycx_fw_info info; 94 - unsigned char image[0]; 94 + unsigned char image[]; 95 95 }; 96 96 97 97 struct cycx_fw_header {
+4 -4
include/uapi/linux/dm-ioctl.h
··· 182 182 struct dm_target_deps { 183 183 __u32 count; /* Array size */ 184 184 __u32 padding; /* unused */ 185 - __u64 dev[0]; /* out */ 185 + __u64 dev[]; /* out */ 186 186 }; 187 187 188 188 /* ··· 192 192 __u64 dev; 193 193 __u32 next; /* offset to the next record from 194 194 the _start_ of this */ 195 - char name[0]; 195 + char name[]; 196 196 197 197 /* 198 198 * The following members can be accessed by taking a pointer that ··· 216 216 __u32 next; 217 217 __u32 version[3]; 218 218 219 - char name[0]; 219 + char name[]; 220 220 }; 221 221 222 222 /* ··· 225 225 struct dm_target_msg { 226 226 __u64 sector; /* Device sector */ 227 227 228 - char message[0]; 228 + char message[]; 229 229 }; 230 230 231 231 /*
+1 -1
include/uapi/linux/dm-log-userspace.h
··· 426 426 __u32 request_type; /* DM_ULOG_* defined above */ 427 427 __u32 data_size; /* How much data (not including this struct) */ 428 428 429 - char data[0]; 429 + char data[]; 430 430 }; 431 431 432 432 #endif /* __DM_LOG_USERSPACE_H__ */
+14 -14
include/uapi/linux/ethtool.h
··· 257 257 __u32 id; 258 258 __u32 type_id; 259 259 __u32 len; 260 - void *data[0]; 260 + void *data[]; 261 261 }; 262 262 263 263 #define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff ··· 322 322 __u32 cmd; 323 323 __u32 version; 324 324 __u32 len; 325 - __u8 data[0]; 325 + __u8 data[]; 326 326 }; 327 327 328 328 /** ··· 348 348 __u32 magic; 349 349 __u32 offset; 350 350 __u32 len; 351 - __u8 data[0]; 351 + __u8 data[]; 352 352 }; 353 353 354 354 /** ··· 752 752 __u32 cmd; 753 753 __u32 string_set; 754 754 __u32 len; 755 - __u8 data[0]; 755 + __u8 data[]; 756 756 }; 757 757 758 758 /** ··· 777 777 __u32 cmd; 778 778 __u32 reserved; 779 779 __u64 sset_mask; 780 - __u32 data[0]; 780 + __u32 data[]; 781 781 }; 782 782 783 783 /** ··· 817 817 __u32 flags; 818 818 __u32 reserved; 819 819 __u32 len; 820 - __u64 data[0]; 820 + __u64 data[]; 821 821 }; 822 822 823 823 /** ··· 834 834 struct ethtool_stats { 835 835 __u32 cmd; 836 836 __u32 n_stats; 837 - __u64 data[0]; 837 + __u64 data[]; 838 838 }; 839 839 840 840 /** ··· 851 851 struct ethtool_perm_addr { 852 852 __u32 cmd; 853 853 __u32 size; 854 - __u8 data[0]; 854 + __u8 data[]; 855 855 }; 856 856 857 857 /* boolean flags controlling per-interface behavior characteristics. ··· 1160 1160 struct ethtool_rxfh_indir { 1161 1161 __u32 cmd; 1162 1162 __u32 size; 1163 - __u32 ring_index[0]; 1163 + __u32 ring_index[]; 1164 1164 }; 1165 1165 1166 1166 /** ··· 1201 1201 __u8 hfunc; 1202 1202 __u8 rsvd8[3]; 1203 1203 __u32 rsvd32; 1204 - __u32 rss_config[0]; 1204 + __u32 rss_config[]; 1205 1205 }; 1206 1206 #define ETH_RXFH_CONTEXT_ALLOC 0xffffffff 1207 1207 #define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff ··· 1286 1286 __u32 version; 1287 1287 __u32 flag; 1288 1288 __u32 len; 1289 - __u8 data[0]; 1289 + __u8 data[]; 1290 1290 }; 1291 1291 1292 1292 #define ETH_FW_DUMP_DISABLE 0 ··· 1318 1318 struct ethtool_gfeatures { 1319 1319 __u32 cmd; 1320 1320 __u32 size; 1321 - struct ethtool_get_features_block features[0]; 1321 + struct ethtool_get_features_block features[]; 1322 1322 }; 1323 1323 1324 1324 /** ··· 1340 1340 struct ethtool_sfeatures { 1341 1341 __u32 cmd; 1342 1342 __u32 size; 1343 - struct ethtool_set_features_block features[0]; 1343 + struct ethtool_set_features_block features[]; 1344 1344 }; 1345 1345 1346 1346 /** ··· 2087 2087 __u8 master_slave_state; 2088 2088 __u8 reserved1[1]; 2089 2089 __u32 reserved[7]; 2090 - __u32 link_mode_masks[0]; 2090 + __u32 link_mode_masks[]; 2091 2091 /* layout of link_mode_masks fields: 2092 2092 * __u32 map_supported[link_mode_masks_nwords]; 2093 2093 * __u32 map_advertising[link_mode_masks_nwords];
+1 -1
include/uapi/linux/fanotify.h
··· 162 162 * Following is an opaque struct file_handle that can be passed as 163 163 * an argument to open_by_handle_at(2). 164 164 */ 165 - unsigned char handle[0]; 165 + unsigned char handle[]; 166 166 }; 167 167 168 168 /*
+1 -1
include/uapi/linux/fiemap.h
··· 34 34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ 35 35 __u32 fm_extent_count; /* size of fm_extents array (in) */ 36 36 __u32 fm_reserved; 37 - struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ 37 + struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */ 38 38 }; 39 39 40 40 #define FIEMAP_MAX_OFFSET (~0ULL)
+6 -6
include/uapi/linux/firewire-cdev.h
··· 118 118 __u32 type; 119 119 __u32 rcode; 120 120 __u32 length; 121 - __u32 data[0]; 121 + __u32 data[]; 122 122 }; 123 123 124 124 /** ··· 142 142 __u64 offset; 143 143 __u32 handle; 144 144 __u32 length; 145 - __u32 data[0]; 145 + __u32 data[]; 146 146 }; 147 147 148 148 /** ··· 205 205 __u32 generation; 206 206 __u32 handle; 207 207 __u32 length; 208 - __u32 data[0]; 208 + __u32 data[]; 209 209 }; 210 210 211 211 /** ··· 265 265 __u32 type; 266 266 __u32 cycle; 267 267 __u32 header_length; 268 - __u32 header[0]; 268 + __u32 header[]; 269 269 }; 270 270 271 271 /** ··· 355 355 __u32 type; 356 356 __u32 rcode; 357 357 __u32 length; 358 - __u32 data[0]; 358 + __u32 data[]; 359 359 }; 360 360 361 361 /** ··· 803 803 */ 804 804 struct fw_cdev_iso_packet { 805 805 __u32 control; 806 - __u32 header[0]; 806 + __u32 header[]; 807 807 }; 808 808 809 809 /**
+1 -1
include/uapi/linux/fs.h
··· 90 90 __u16 dest_count; /* in - total elements in info array */ 91 91 __u16 reserved1; /* must be zero */ 92 92 __u32 reserved2; /* must be zero */ 93 - struct file_dedupe_range_info info[0]; 93 + struct file_dedupe_range_info info[]; 94 94 }; 95 95 96 96 /* And dynamically-tunable limits and defaults: */
+1 -1
include/uapi/linux/if_alg.h
··· 42 42 43 43 struct af_alg_iv { 44 44 __u32 ivlen; 45 - __u8 iv[0]; 45 + __u8 iv[]; 46 46 }; 47 47 48 48 /* Socket options */
+3 -3
include/uapi/linux/if_arcnet.h
··· 60 60 __u8 proto; /* protocol ID field - varies */ 61 61 __u8 split_flag; /* for use with split packets */ 62 62 __be16 sequence; /* sequence number */ 63 - __u8 payload[0]; /* space remaining in packet (504 bytes)*/ 63 + __u8 payload[]; /* space remaining in packet (504 bytes)*/ 64 64 }; 65 65 #define RFC1201_HDR_SIZE 4 66 66 ··· 69 69 */ 70 70 struct arc_rfc1051 { 71 71 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ 72 - __u8 payload[0]; /* 507 bytes */ 72 + __u8 payload[]; /* 507 bytes */ 73 73 }; 74 74 #define RFC1051_HDR_SIZE 1 75 75 ··· 80 80 struct arc_eth_encap { 81 81 __u8 proto; /* Always ARC_P_ETHER */ 82 82 struct ethhdr eth; /* standard ethernet header (yuck!) */ 83 - __u8 payload[0]; /* 493 bytes */ 83 + __u8 payload[]; /* 493 bytes */ 84 84 }; 85 85 #define ETH_ENCAP_HDR_SIZE 14 86 86
+2 -2
include/uapi/linux/if_pppox.h
··· 122 122 struct pppoe_tag { 123 123 __be16 tag_type; 124 124 __be16 tag_len; 125 - char tag_data[0]; 125 + char tag_data[]; 126 126 } __attribute__ ((packed)); 127 127 128 128 /* Tag identifiers */ ··· 150 150 __u8 code; 151 151 __be16 sid; 152 152 __be16 length; 153 - struct pppoe_tag tag[0]; 153 + struct pppoe_tag tag[]; 154 154 } __packed; 155 155 156 156 /* Length of entire PPPoE + PPP header */
+1 -1
include/uapi/linux/if_tun.h
··· 108 108 struct tun_filter { 109 109 __u16 flags; /* TUN_FLT_ flags see above */ 110 110 __u16 count; /* Number of addresses */ 111 - __u8 addr[0][ETH_ALEN]; 111 + __u8 addr[][ETH_ALEN]; 112 112 }; 113 113 114 114 #endif /* _UAPI__IF_TUN_H */
+3 -3
include/uapi/linux/igmp.h
··· 48 48 __u8 grec_auxwords; 49 49 __be16 grec_nsrcs; 50 50 __be32 grec_mca; 51 - __be32 grec_src[0]; 51 + __be32 grec_src[]; 52 52 }; 53 53 54 54 struct igmpv3_report { ··· 57 57 __sum16 csum; 58 58 __be16 resv2; 59 59 __be16 ngrec; 60 - struct igmpv3_grec grec[0]; 60 + struct igmpv3_grec grec[]; 61 61 }; 62 62 63 63 struct igmpv3_query { ··· 78 78 #endif 79 79 __u8 qqic; 80 80 __be16 nsrcs; 81 - __be32 srcs[0]; 81 + __be32 srcs[]; 82 82 }; 83 83 84 84 #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
+1 -1
include/uapi/linux/inet_diag.h
··· 104 104 __u8 family; 105 105 __u8 prefix_len; 106 106 int port; 107 - __be32 addr[0]; 107 + __be32 addr[]; 108 108 }; 109 109 110 110 struct inet_diag_markcond {
+1 -1
include/uapi/linux/inotify.h
··· 23 23 __u32 mask; /* watch mask */ 24 24 __u32 cookie; /* cookie to synchronize two events */ 25 25 __u32 len; /* length (including nulls) of name */ 26 - char name[0]; /* stub for possible name */ 26 + char name[]; /* stub for possible name */ 27 27 }; 28 28 29 29 /* the following are legal, implemented events that user-space can watch for */
+2 -2
include/uapi/linux/ip.h
··· 112 112 __be16 reserved; 113 113 __be32 spi; 114 114 __be32 seq_no; /* Sequence number */ 115 - __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ 115 + __u8 auth_data[]; /* Variable len but >=4. Mind the 64 bit alignment! */ 116 116 }; 117 117 118 118 struct ip_esp_hdr { 119 119 __be32 spi; 120 120 __be32 seq_no; /* Sequence number */ 121 - __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ 121 + __u8 enc_data[]; /* Variable len but >=8. Mind the 64 bit alignment! */ 122 122 }; 123 123 124 124 struct ip_comp_hdr {
+2 -2
include/uapi/linux/ip_vs.h
··· 254 254 unsigned int num_dests; 255 255 256 256 /* the real servers */ 257 - struct ip_vs_dest_entry entrytable[0]; 257 + struct ip_vs_dest_entry entrytable[]; 258 258 }; 259 259 260 260 ··· 264 264 unsigned int num_services; 265 265 266 266 /* service table */ 267 - struct ip_vs_service_entry entrytable[0]; 267 + struct ip_vs_service_entry entrytable[]; 268 268 }; 269 269 270 270
+2 -2
include/uapi/linux/iso_fs.h
··· 137 137 __u8 name_len[2]; /* 721 */ 138 138 __u8 extent[4]; /* 731 */ 139 139 __u8 parent[2]; /* 721 */ 140 - char name[0]; 140 + char name[]; 141 141 } __attribute__((packed)); 142 142 143 143 /* high sierra is identical to iso, except that the date is only 6 bytes, and ··· 154 154 __u8 interleave [ISODCL (28, 28)]; /* 711 */ 155 155 __u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */ 156 156 __u8 name_len [ISODCL (33, 33)]; /* 711 */ 157 - char name [0]; 157 + char name []; 158 158 } __attribute__((packed)); 159 159 160 160 #define ISOFS_BLOCK_BITS 11
+4 -4
include/uapi/linux/jffs2.h
··· 123 123 __u8 unused[2]; 124 124 jint32_t node_crc; 125 125 jint32_t name_crc; 126 - __u8 name[0]; 126 + __u8 name[]; 127 127 }; 128 128 129 129 /* The JFFS2 raw inode structure: Used for storage on physical media. */ ··· 155 155 jint16_t flags; /* See JFFS2_INO_FLAG_* */ 156 156 jint32_t data_crc; /* CRC for the (compressed) data. */ 157 157 jint32_t node_crc; /* CRC for the raw inode (excluding data) */ 158 - __u8 data[0]; 158 + __u8 data[]; 159 159 }; 160 160 161 161 struct jffs2_raw_xattr { ··· 170 170 jint16_t value_len; 171 171 jint32_t data_crc; 172 172 jint32_t node_crc; 173 - __u8 data[0]; 173 + __u8 data[]; 174 174 } __attribute__((packed)); 175 175 176 176 struct jffs2_raw_xref ··· 196 196 jint32_t padded; /* sum of the size of padding nodes */ 197 197 jint32_t sum_crc; /* summary information crc */ 198 198 jint32_t node_crc; /* node crc */ 199 - jint32_t sum[0]; /* inode summary info */ 199 + jint32_t sum[]; /* inode summary info */ 200 200 }; 201 201 202 202 union jffs2_node_union
+1 -1
include/uapi/linux/kcov.h
··· 13 13 __u32 area_size; /* Length of coverage buffer in words */ 14 14 __u32 num_handles; /* Size of handles array */ 15 15 __aligned_u64 common_handle; 16 - __aligned_u64 handles[0]; 16 + __aligned_u64 handles[]; 17 17 }; 18 18 19 19 #define KCOV_REMOTE_MAX_HANDLES 0x100
+4 -4
include/uapi/linux/kvm.h
··· 542 542 543 543 struct kvm_coalesced_mmio_ring { 544 544 __u32 first, last; 545 - struct kvm_coalesced_mmio coalesced_mmio[0]; 545 + struct kvm_coalesced_mmio coalesced_mmio[]; 546 546 }; 547 547 548 548 #define KVM_COALESCED_MMIO_MAX \ ··· 621 621 /* for KVM_SET_SIGNAL_MASK */ 622 622 struct kvm_signal_mask { 623 623 __u32 len; 624 - __u8 sigset[0]; 624 + __u8 sigset[]; 625 625 }; 626 626 627 627 /* for KVM_TPR_ACCESS_REPORTING */ ··· 1221 1221 struct kvm_irq_routing { 1222 1222 __u32 nr; 1223 1223 __u32 flags; 1224 - struct kvm_irq_routing_entry entries[0]; 1224 + struct kvm_irq_routing_entry entries[]; 1225 1225 }; 1226 1226 1227 1227 #endif ··· 1341 1341 1342 1342 struct kvm_reg_list { 1343 1343 __u64 n; /* number of regs */ 1344 - __u64 reg[0]; 1344 + __u64 reg[]; 1345 1345 }; 1346 1346 1347 1347 struct kvm_one_reg {
+2 -2
include/uapi/linux/minix_fs.h
··· 97 97 98 98 struct minix_dir_entry { 99 99 __u16 inode; 100 - char name[0]; 100 + char name[]; 101 101 }; 102 102 103 103 struct minix3_dir_entry { 104 104 __u32 inode; 105 - char name[0]; 105 + char name[]; 106 106 }; 107 107 #endif
+1 -1
include/uapi/linux/mmc/ioctl.h
··· 58 58 */ 59 59 struct mmc_ioc_multi_cmd { 60 60 __u64 num_of_cmds; 61 - struct mmc_ioc_cmd cmds[0]; 61 + struct mmc_ioc_cmd cmds[]; 62 62 }; 63 63 64 64 #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
+5 -5
include/uapi/linux/ndctl.h
··· 30 30 __u32 in_offset; 31 31 __u32 in_length; 32 32 __u32 status; 33 - __u8 out_buf[0]; 33 + __u8 out_buf[]; 34 34 } __packed; 35 35 36 36 struct nd_cmd_set_config_hdr { 37 37 __u32 in_offset; 38 38 __u32 in_length; 39 - __u8 in_buf[0]; 39 + __u8 in_buf[]; 40 40 } __packed; 41 41 42 42 struct nd_cmd_vendor_hdr { 43 43 __u32 opcode; 44 44 __u32 in_length; 45 - __u8 in_buf[0]; 45 + __u8 in_buf[]; 46 46 } __packed; 47 47 48 48 struct nd_cmd_vendor_tail { 49 49 __u32 status; 50 50 __u32 out_length; 51 - __u8 out_buf[0]; 51 + __u8 out_buf[]; 52 52 } __packed; 53 53 54 54 struct nd_cmd_ars_cap { ··· 86 86 __u32 reserved; 87 87 __u64 err_address; 88 88 __u64 length; 89 - } __packed records[0]; 89 + } __packed records[]; 90 90 } __packed; 91 91 92 92 struct nd_cmd_clear_error {
+2 -2
include/uapi/linux/net_dropmon.h
··· 29 29 30 30 struct net_dm_config_msg { 31 31 __u32 entries; 32 - struct net_dm_config_entry options[0]; 32 + struct net_dm_config_entry options[]; 33 33 }; 34 34 35 35 struct net_dm_alert_msg { 36 36 __u32 entries; 37 - struct net_dm_drop_point points[0]; 37 + struct net_dm_drop_point points[]; 38 38 }; 39 39 40 40 struct net_dm_user_msg {
+2 -2
include/uapi/linux/netfilter/x_tables.h
··· 28 28 __u16 match_size; 29 29 } u; 30 30 31 - unsigned char data[0]; 31 + unsigned char data[]; 32 32 }; 33 33 34 34 struct xt_entry_target { ··· 119 119 unsigned int num_counters; 120 120 121 121 /* The counters (actually `number' of these). */ 122 - struct xt_counters counters[0]; 122 + struct xt_counters counters[]; 123 123 }; 124 124 125 125 #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
+3 -3
include/uapi/linux/netfilter_arp/arp_tables.h
··· 109 109 struct xt_counters counters; 110 110 111 111 /* The matches (if any), then the target. */ 112 - unsigned char elems[0]; 112 + unsigned char elems[]; 113 113 }; 114 114 115 115 /* ··· 181 181 struct xt_counters __user *counters; 182 182 183 183 /* The entries (hang off end: not really an array). */ 184 - struct arpt_entry entries[0]; 184 + struct arpt_entry entries[]; 185 185 }; 186 186 187 187 /* The argument to ARPT_SO_GET_ENTRIES. */ ··· 193 193 unsigned int size; 194 194 195 195 /* The entries. */ 196 - struct arpt_entry entrytable[0]; 196 + struct arpt_entry entrytable[]; 197 197 }; 198 198 199 199 /* Helper functions */
+1 -1
include/uapi/linux/netfilter_bridge/ebt_among.h
··· 40 40 struct ebt_mac_wormhash { 41 41 int table[257]; 42 42 int poolsize; 43 - struct ebt_mac_wormhash_tuple pool[0]; 43 + struct ebt_mac_wormhash_tuple pool[]; 44 44 }; 45 45 46 46 #define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
+3 -3
include/uapi/linux/netfilter_ipv4/ip_tables.h
··· 121 121 struct xt_counters counters; 122 122 123 123 /* The matches (if any), then the target. */ 124 - unsigned char elems[0]; 124 + unsigned char elems[]; 125 125 }; 126 126 127 127 /* ··· 203 203 struct xt_counters __user *counters; 204 204 205 205 /* The entries (hang off end: not really an array). */ 206 - struct ipt_entry entries[0]; 206 + struct ipt_entry entries[]; 207 207 }; 208 208 209 209 /* The argument to IPT_SO_GET_ENTRIES. */ ··· 215 215 unsigned int size; 216 216 217 217 /* The entries. */ 218 - struct ipt_entry entrytable[0]; 218 + struct ipt_entry entrytable[]; 219 219 }; 220 220 221 221 /* Helper functions */
+2 -2
include/uapi/linux/netfilter_ipv6/ip6_tables.h
··· 243 243 struct xt_counters __user *counters; 244 244 245 245 /* The entries (hang off end: not really an array). */ 246 - struct ip6t_entry entries[0]; 246 + struct ip6t_entry entries[]; 247 247 }; 248 248 249 249 /* The argument to IP6T_SO_GET_ENTRIES. */ ··· 255 255 unsigned int size; 256 256 257 257 /* The entries. */ 258 - struct ip6t_entry entrytable[0]; 258 + struct ip6t_entry entrytable[]; 259 259 }; 260 260 261 261 /* Helper functions */
+1 -1
include/uapi/linux/perf_event.h
··· 491 491 /* 492 492 * User provided buffer to store program ids 493 493 */ 494 - __u32 ids[0]; 494 + __u32 ids[]; 495 495 }; 496 496 497 497 /*
+2 -2
include/uapi/linux/pkt_cls.h
··· 256 256 257 257 short hoff; 258 258 __be32 hmask; 259 - struct tc_u32_key keys[0]; 259 + struct tc_u32_key keys[]; 260 260 }; 261 261 262 262 struct tc_u32_mark { ··· 268 268 struct tc_u32_pcnt { 269 269 __u64 rcnt; 270 270 __u64 rhit; 271 - __u64 kcnts[0]; 271 + __u64 kcnts[]; 272 272 }; 273 273 274 274 /* Flags */
+1 -1
include/uapi/linux/raid/md_p.h
··· 303 303 * into the 'roles' value. If a device is spare or faulty, then it doesn't 304 304 * have a meaningful role. 305 305 */ 306 - __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 306 + __le16 dev_roles[]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 307 307 }; 308 308 309 309 /* feature_map bits */
+1 -1
include/uapi/linux/random.h
··· 41 41 struct rand_pool_info { 42 42 int entropy_count; 43 43 int buf_size; 44 - __u32 buf[0]; 44 + __u32 buf[]; 45 45 }; 46 46 47 47 /*
+2 -2
include/uapi/linux/romfs_fs.h
··· 27 27 __be32 word1; 28 28 __be32 size; 29 29 __be32 checksum; 30 - char name[0]; /* volume name */ 30 + char name[]; /* volume name */ 31 31 }; 32 32 33 33 /* On disk inode */ ··· 37 37 __be32 spec; 38 38 __be32 size; 39 39 __be32 checksum; 40 - char name[0]; 40 + char name[]; 41 41 }; 42 42 43 43 #define ROMFH_TYPE 7
+1 -1
include/uapi/linux/rtnetlink.h
··· 440 440 /* RTA_VIA */ 441 441 struct rtvia { 442 442 __kernel_sa_family_t rtvia_family; 443 - __u8 rtvia_addr[0]; 443 + __u8 rtvia_addr[]; 444 444 }; 445 445 446 446 /* RTM_CACHEINFO */
+5 -5
include/uapi/linux/sctp.h
··· 365 365 __u16 sac_outbound_streams; 366 366 __u16 sac_inbound_streams; 367 367 sctp_assoc_t sac_assoc_id; 368 - __u8 sac_info[0]; 368 + __u8 sac_info[]; 369 369 }; 370 370 371 371 /* ··· 436 436 __u32 sre_length; 437 437 __be16 sre_error; 438 438 sctp_assoc_t sre_assoc_id; 439 - __u8 sre_data[0]; 439 + __u8 sre_data[]; 440 440 }; 441 441 442 442 ··· 453 453 __u32 ssf_error; 454 454 struct sctp_sndrcvinfo ssf_info; 455 455 sctp_assoc_t ssf_assoc_id; 456 - __u8 ssf_data[0]; 456 + __u8 ssf_data[]; 457 457 }; 458 458 459 459 struct sctp_send_failed_event { ··· 463 463 __u32 ssf_error; 464 464 struct sctp_sndinfo ssfe_info; 465 465 sctp_assoc_t ssf_assoc_id; 466 - __u8 ssf_data[0]; 466 + __u8 ssf_data[]; 467 467 }; 468 468 469 469 /* ··· 1029 1029 struct sctp_getaddrs { 1030 1030 sctp_assoc_t assoc_id; /*input*/ 1031 1031 __u32 addr_num; /*output*/ 1032 - __u8 addrs[0]; /*output, variable size*/ 1032 + __u8 addrs[]; /*output, variable size*/ 1033 1033 }; 1034 1034 1035 1035 /* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
+1 -1
include/uapi/linux/seg6.h
··· 30 30 __u8 flags; 31 31 __u16 tag; 32 32 33 - struct in6_addr segments[0]; 33 + struct in6_addr segments[]; 34 34 }; 35 35 36 36 #define SR6_FLAG1_PROTECTED (1 << 6)
+1 -1
include/uapi/linux/seg6_iptunnel.h
··· 26 26 27 27 struct seg6_iptunnel_encap { 28 28 int mode; 29 - struct ipv6_sr_hdr srh[0]; 29 + struct ipv6_sr_hdr srh[]; 30 30 }; 31 31 32 32 #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
+1 -1
include/uapi/linux/stm.h
··· 36 36 /* padding */ 37 37 __u16 __reserved_0; 38 38 __u32 __reserved_1; 39 - char id[0]; 39 + char id[]; 40 40 }; 41 41 42 42 #define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)
+1 -1
include/uapi/linux/target_core_user.h
··· 152 152 __u32 cmd_cnt; 153 153 __u64 __pad3; 154 154 __u64 __pad4; 155 - __u16 cmd_ids[0]; 155 + __u16 cmd_ids[]; 156 156 } __packed; 157 157 158 158 #define TCMU_OP_ALIGN_SIZE sizeof(__u64)
+1 -1
include/uapi/linux/usb/audio.h
··· 341 341 __u8 bUnitID; 342 342 __u8 bSourceID; 343 343 __u8 bControlSize; 344 - __u8 bmaControls[0]; /* variable length */ 344 + __u8 bmaControls[]; /* variable length */ 345 345 } __attribute__((packed)); 346 346 347 347 static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
+3 -3
include/uapi/linux/usb/cdc.h
··· 171 171 172 172 /* type is associated with mdlm_desc.bGUID */ 173 173 __u8 bGuidDescriptorType; 174 - __u8 bDetailData[0]; 174 + __u8 bDetailData[]; 175 175 } __attribute__ ((packed)); 176 176 177 177 /* "OBEX Control Model Functional Descriptor" */ ··· 379 379 __le32 dwSignature; 380 380 __le16 wLength; 381 381 __le16 wNextNdpIndex; 382 - struct usb_cdc_ncm_dpe16 dpe16[0]; 382 + struct usb_cdc_ncm_dpe16 dpe16[]; 383 383 } __attribute__ ((packed)); 384 384 385 385 /* 32-bit NCM Datagram Pointer Entry */ ··· 395 395 __le16 wReserved6; 396 396 __le32 dwNextNdpIndex; 397 397 __le32 dwReserved12; 398 - struct usb_cdc_ncm_dpe32 dpe32[0]; 398 + struct usb_cdc_ncm_dpe32 dpe32[]; 399 399 } __attribute__ ((packed)); 400 400 401 401 /* CDC NCM subclass 3.2.1 and 3.2.2 */
+1 -1
include/uapi/linux/usb/ch9.h
··· 818 818 819 819 __u8 tTKID[3]; 820 820 __u8 bReserved; 821 - __u8 bKeyData[0]; 821 + __u8 bKeyData[]; 822 822 } __attribute__((packed)); 823 823 824 824 /*-------------------------------------------------------------------------*/
+2 -2
include/uapi/linux/usb/raw_gadget.h
··· 60 60 struct usb_raw_event { 61 61 __u32 type; 62 62 __u32 length; 63 - __u8 data[0]; 63 + __u8 data[]; 64 64 }; 65 65 66 66 #define USB_RAW_IO_FLAGS_ZERO 0x0001 ··· 90 90 __u16 ep; 91 91 __u16 flags; 92 92 __u32 length; 93 - __u8 data[0]; 93 + __u8 data[]; 94 94 }; 95 95 96 96 /* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
+2 -2
include/uapi/linux/usbdevice_fs.h
··· 131 131 unsigned int signr; /* signal to be sent on completion, 132 132 or 0 if none should be sent. */ 133 133 void __user *usercontext; 134 - struct usbdevfs_iso_packet_desc iso_frame_desc[0]; 134 + struct usbdevfs_iso_packet_desc iso_frame_desc[]; 135 135 }; 136 136 137 137 /* ioctls for talking directly to drivers */ ··· 176 176 struct usbdevfs_streams { 177 177 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */ 178 178 unsigned int num_eps; 179 - unsigned char eps[0]; 179 + unsigned char eps[]; 180 180 }; 181 181 182 182 /*
+2 -2
include/uapi/linux/vhost_types.h
··· 107 107 struct vhost_memory { 108 108 __u32 nregions; 109 109 __u32 padding; 110 - struct vhost_memory_region regions[0]; 110 + struct vhost_memory_region regions[]; 111 111 }; 112 112 113 113 /* VHOST_SCSI specific definitions */ ··· 135 135 struct vhost_vdpa_config { 136 136 __u32 off; 137 137 __u32 len; 138 - __u8 buf[0]; 138 + __u8 buf[]; 139 139 }; 140 140 141 141 /* vhost vdpa IOVA range
+1 -1
include/uapi/linux/virtio_9p.h
··· 38 38 /* length of the tag name */ 39 39 __virtio16 tag_len; 40 40 /* non-NULL terminated tag name */ 41 - __u8 tag[0]; 41 + __u8 tag[]; 42 42 } __attribute__((packed)); 43 43 44 44 #endif /* _LINUX_VIRTIO_9P_H */
+5 -5
include/uapi/linux/xfrm.h
··· 33 33 __u8 ctx_alg; 34 34 __u16 ctx_len; 35 35 __u32 ctx_sid; 36 - char ctx_str[0]; 36 + char ctx_str[]; 37 37 }; 38 38 39 39 /* Security Context Domains of Interpretation */ ··· 96 96 __u32 oseq_hi; 97 97 __u32 seq_hi; 98 98 __u32 replay_window; 99 - __u32 bmp[0]; 99 + __u32 bmp[]; 100 100 }; 101 101 102 102 struct xfrm_algo { 103 103 char alg_name[64]; 104 104 unsigned int alg_key_len; /* in bits */ 105 - char alg_key[0]; 105 + char alg_key[]; 106 106 }; 107 107 108 108 struct xfrm_algo_auth { 109 109 char alg_name[64]; 110 110 unsigned int alg_key_len; /* in bits */ 111 111 unsigned int alg_trunc_len; /* in bits */ 112 - char alg_key[0]; 112 + char alg_key[]; 113 113 }; 114 114 115 115 struct xfrm_algo_aead { 116 116 char alg_name[64]; 117 117 unsigned int alg_key_len; /* in bits */ 118 118 unsigned int alg_icv_len; /* in bits */ 119 - char alg_key[0]; 119 + char alg_key[]; 120 120 }; 121 121 122 122 struct xfrm_stats {
+1 -1
include/uapi/rdma/hfi/hfi1_user.h
··· 180 180 struct hfi1_status { 181 181 __aligned_u64 dev; /* device/hw status bits */ 182 182 __aligned_u64 port; /* port state and status bits */ 183 - char freezemsg[0]; 183 + char freezemsg[]; 184 184 }; 185 185 186 186 enum sdma_req_opcode {
+36 -36
include/uapi/rdma/ib_user_verbs.h
··· 158 158 159 159 struct ib_uverbs_get_context { 160 160 __aligned_u64 response; 161 - __aligned_u64 driver_data[0]; 161 + __aligned_u64 driver_data[]; 162 162 }; 163 163 164 164 struct ib_uverbs_get_context_resp { 165 165 __u32 async_fd; 166 166 __u32 num_comp_vectors; 167 - __aligned_u64 driver_data[0]; 167 + __aligned_u64 driver_data[]; 168 168 }; 169 169 170 170 struct ib_uverbs_query_device { 171 171 __aligned_u64 response; 172 - __aligned_u64 driver_data[0]; 172 + __aligned_u64 driver_data[]; 173 173 }; 174 174 175 175 struct ib_uverbs_query_device_resp { ··· 278 278 __aligned_u64 response; 279 279 __u8 port_num; 280 280 __u8 reserved[7]; 281 - __aligned_u64 driver_data[0]; 281 + __aligned_u64 driver_data[]; 282 282 }; 283 283 284 284 struct ib_uverbs_query_port_resp { ··· 308 308 309 309 struct ib_uverbs_alloc_pd { 310 310 __aligned_u64 response; 311 - __aligned_u64 driver_data[0]; 311 + __aligned_u64 driver_data[]; 312 312 }; 313 313 314 314 struct ib_uverbs_alloc_pd_resp { 315 315 __u32 pd_handle; 316 - __u32 driver_data[0]; 316 + __u32 driver_data[]; 317 317 }; 318 318 319 319 struct ib_uverbs_dealloc_pd { ··· 324 324 __aligned_u64 response; 325 325 __u32 fd; 326 326 __u32 oflags; 327 - __aligned_u64 driver_data[0]; 327 + __aligned_u64 driver_data[]; 328 328 }; 329 329 330 330 struct ib_uverbs_open_xrcd_resp { 331 331 __u32 xrcd_handle; 332 - __u32 driver_data[0]; 332 + __u32 driver_data[]; 333 333 }; 334 334 335 335 struct ib_uverbs_close_xrcd { ··· 343 343 __aligned_u64 hca_va; 344 344 __u32 pd_handle; 345 345 __u32 access_flags; 346 - __aligned_u64 driver_data[0]; 346 + __aligned_u64 driver_data[]; 347 347 }; 348 348 349 349 struct ib_uverbs_reg_mr_resp { 350 350 __u32 mr_handle; 351 351 __u32 lkey; 352 352 __u32 rkey; 353 - __u32 driver_data[0]; 353 + __u32 driver_data[]; 354 354 }; 355 355 356 356 struct ib_uverbs_rereg_mr { ··· 362 362 __aligned_u64 hca_va; 363 363 __u32 pd_handle; 364 364 __u32 access_flags; 365 - __aligned_u64 driver_data[0]; 365 + __aligned_u64 driver_data[]; 366 366 }; 367 367 368 368 struct ib_uverbs_rereg_mr_resp { 369 369 __u32 lkey; 370 370 __u32 rkey; 371 - __aligned_u64 driver_data[0]; 371 + __aligned_u64 driver_data[]; 372 372 }; 373 373 374 374 struct ib_uverbs_dereg_mr { ··· 380 380 __u32 pd_handle; 381 381 __u8 mw_type; 382 382 __u8 reserved[3]; 383 - __aligned_u64 driver_data[0]; 383 + __aligned_u64 driver_data[]; 384 384 }; 385 385 386 386 struct ib_uverbs_alloc_mw_resp { 387 387 __u32 mw_handle; 388 388 __u32 rkey; 389 - __aligned_u64 driver_data[0]; 389 + __aligned_u64 driver_data[]; 390 390 }; 391 391 392 392 struct ib_uverbs_dealloc_mw { ··· 408 408 __u32 comp_vector; 409 409 __s32 comp_channel; 410 410 __u32 reserved; 411 - __aligned_u64 driver_data[0]; 411 + __aligned_u64 driver_data[]; 412 412 }; 413 413 414 414 enum ib_uverbs_ex_create_cq_flags { ··· 442 442 __aligned_u64 response; 443 443 __u32 cq_handle; 444 444 __u32 cqe; 445 - __aligned_u64 driver_data[0]; 445 + __aligned_u64 driver_data[]; 446 446 }; 447 447 448 448 struct ib_uverbs_resize_cq_resp { 449 449 __u32 cqe; 450 450 __u32 reserved; 451 - __aligned_u64 driver_data[0]; 451 + __aligned_u64 driver_data[]; 452 452 }; 453 453 454 454 struct ib_uverbs_poll_cq { ··· 492 492 struct ib_uverbs_poll_cq_resp { 493 493 __u32 count; 494 494 __u32 reserved; 495 - struct ib_uverbs_wc wc[0]; 495 + struct ib_uverbs_wc wc[]; 496 496 }; 497 497 498 498 struct ib_uverbs_req_notify_cq { ··· 585 585 __u8 qp_type; 586 586 __u8 is_srq; 587 587 __u8 reserved; 588 - __aligned_u64 driver_data[0]; 588 + __aligned_u64 driver_data[]; 589 589 }; 590 590 591 591 enum ib_uverbs_create_qp_mask { ··· 624 624 __u32 qpn; 625 625 __u8 qp_type; 626 626 __u8 reserved[7]; 627 - __aligned_u64 driver_data[0]; 627 + __aligned_u64 driver_data[]; 628 628 }; 629 629 630 630 /* also used for open response */ ··· 669 669 __aligned_u64 response; 670 670 __u32 qp_handle; 671 671 __u32 attr_mask; 672 - __aligned_u64 driver_data[0]; 672 + __aligned_u64 driver_data[]; 673 673 }; 674 674 675 675 struct ib_uverbs_query_qp_resp { ··· 703 703 __u8 alt_timeout; 704 704 __u8 sq_sig_all; 705 705 __u8 reserved[5]; 706 - __aligned_u64 driver_data[0]; 706 + __aligned_u64 driver_data[]; 707 707 }; 708 708 709 709 struct ib_uverbs_modify_qp { ··· 824 824 __u32 wr_count; 825 825 __u32 sge_count; 826 826 __u32 wqe_size; 827 - struct ib_uverbs_send_wr send_wr[0]; 827 + struct ib_uverbs_send_wr send_wr[]; 828 828 }; 829 829 830 830 struct ib_uverbs_post_send_resp { ··· 843 843 __u32 wr_count; 844 844 __u32 sge_count; 845 845 __u32 wqe_size; 846 - struct ib_uverbs_recv_wr recv_wr[0]; 846 + struct ib_uverbs_recv_wr recv_wr[]; 847 847 }; 848 848 849 849 struct ib_uverbs_post_recv_resp { ··· 856 856 __u32 wr_count; 857 857 __u32 sge_count; 858 858 __u32 wqe_size; 859 - struct ib_uverbs_recv_wr recv[0]; 859 + struct ib_uverbs_recv_wr recv[]; 860 860 }; 861 861 862 862 struct ib_uverbs_post_srq_recv_resp { ··· 869 869 __u32 pd_handle; 870 870 __u32 reserved; 871 871 struct ib_uverbs_ah_attr attr; 872 - __aligned_u64 driver_data[0]; 872 + __aligned_u64 driver_data[]; 873 873 }; 874 874 875 875 struct ib_uverbs_create_ah_resp { 876 876 __u32 ah_handle; 877 - __u32 driver_data[0]; 877 + __u32 driver_data[]; 878 878 }; 879 879 880 880 struct ib_uverbs_destroy_ah { ··· 886 886 __u32 qp_handle; 887 887 __u16 mlid; 888 888 __u16 reserved; 889 - __aligned_u64 driver_data[0]; 889 + __aligned_u64 driver_data[]; 890 890 }; 891 891 892 892 struct ib_uverbs_detach_mcast { ··· 894 894 __u32 qp_handle; 895 895 __u16 mlid; 896 896 __u16 reserved; 897 - __aligned_u64 driver_data[0]; 897 + __aligned_u64 driver_data[]; 898 898 }; 899 899 900 900 struct ib_uverbs_flow_spec_hdr { ··· 1135 1135 * struct ib_flow_spec_xxx 1136 1136 * struct ib_flow_spec_yyy 1137 1137 */ 1138 - struct ib_uverbs_flow_spec_hdr flow_specs[0]; 1138 + struct ib_uverbs_flow_spec_hdr flow_specs[]; 1139 1139 }; 1140 1140 1141 1141 struct ib_uverbs_create_flow { ··· 1161 1161 __u32 max_wr; 1162 1162 __u32 max_sge; 1163 1163 __u32 srq_limit; 1164 - __aligned_u64 driver_data[0]; 1164 + __aligned_u64 driver_data[]; 1165 1165 }; 1166 1166 1167 1167 struct ib_uverbs_create_xsrq { ··· 1175 1175 __u32 max_num_tags; 1176 1176 __u32 xrcd_handle; 1177 1177 __u32 cq_handle; 1178 - __aligned_u64 driver_data[0]; 1178 + __aligned_u64 driver_data[]; 1179 1179 }; 1180 1180 1181 1181 struct ib_uverbs_create_srq_resp { ··· 1183 1183 __u32 max_wr; 1184 1184 __u32 max_sge; 1185 1185 __u32 srqn; 1186 - __u32 driver_data[0]; 1186 + __u32 driver_data[]; 1187 1187 }; 1188 1188 1189 1189 struct ib_uverbs_modify_srq { ··· 1191 1191 __u32 attr_mask; 1192 1192 __u32 max_wr; 1193 1193 __u32 srq_limit; 1194 - __aligned_u64 driver_data[0]; 1194 + __aligned_u64 driver_data[]; 1195 1195 }; 1196 1196 1197 1197 struct ib_uverbs_query_srq { 1198 1198 __aligned_u64 response; 1199 1199 __u32 srq_handle; 1200 1200 __u32 reserved; 1201 - __aligned_u64 driver_data[0]; 1201 + __aligned_u64 driver_data[]; 1202 1202 }; 1203 1203 1204 1204 struct ib_uverbs_query_srq_resp { ··· 1269 1269 * wq_handle1 1270 1270 * wq_handle2 1271 1271 */ 1272 - __u32 wq_handles[0]; 1272 + __u32 wq_handles[]; 1273 1273 }; 1274 1274 1275 1275 struct ib_uverbs_ex_create_rwq_ind_table_resp {
+1 -1
include/uapi/rdma/rdma_user_cm.h
··· 184 184 struct rdma_ucm_query_path_resp { 185 185 __u32 num_paths; 186 186 __u32 reserved; 187 - struct ib_path_rec_data path_data[0]; 187 + struct ib_path_rec_data path_data[]; 188 188 }; 189 189 190 190 struct rdma_ucm_conn_param {
+1 -1
include/uapi/rdma/rdma_user_ioctl_cmds.h
··· 81 81 __aligned_u64 reserved1; 82 82 __u32 driver_id; 83 83 __u32 reserved2; 84 - struct ib_uverbs_attr attrs[0]; 84 + struct ib_uverbs_attr attrs[]; 85 85 }; 86 86 87 87 #endif
+9 -9
include/uapi/scsi/fc/fc_els.h
··· 264 264 * Size of descriptor excluding 265 265 * desc_tag and desc_len fields. 266 266 */ 267 - __u8 desc_value[0]; /* Descriptor Value */ 267 + __u8 desc_value[]; /* Descriptor Value */ 268 268 }; 269 269 270 270 /* Descriptor tag and len fields are considered the mandatory header ··· 1027 1027 * threshold to caause the LI event 1028 1028 */ 1029 1029 __be32 pname_count; /* number of portname_list elements */ 1030 - __be64 pname_list[0]; /* list of N_Port_Names accessible 1030 + __be64 pname_list[]; /* list of N_Port_Names accessible 1031 1031 * through the attached port 1032 1032 */ 1033 1033 }; ··· 1069 1069 * congestion event 1070 1070 */ 1071 1071 __be32 pname_count; /* number of portname_list elements */ 1072 - __be64 pname_list[0]; /* list of N_Port_Names accessible 1072 + __be64 pname_list[]; /* list of N_Port_Names accessible 1073 1073 * through the attached port 1074 1074 */ 1075 1075 }; ··· 1104 1104 * Size of ELS excluding fpin_cmd, 1105 1105 * fpin_zero and desc_len fields. 1106 1106 */ 1107 - struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */ 1107 + struct fc_tlv_desc fpin_desc[]; /* Descriptor list */ 1108 1108 }; 1109 1109 1110 1110 /* Diagnostic Function Descriptor - FPIN Registration */ ··· 1115 1115 * desc_tag and desc_len fields. 1116 1116 */ 1117 1117 __be32 count; /* Number of desc_tags elements */ 1118 - __be32 desc_tags[0]; /* Array of Descriptor Tags. 1118 + __be32 desc_tags[]; /* Array of Descriptor Tags. 1119 1119 * Each tag indicates a function 1120 1120 * supported by the N_Port (request) 1121 1121 * or by the N_Port and Fabric ··· 1135 1135 * Size of ELS excluding fpin_cmd, 1136 1136 * fpin_zero and desc_len fields. 1137 1137 */ 1138 - struct fc_tlv_desc desc[0]; /* Descriptor list */ 1138 + struct fc_tlv_desc desc[]; /* Descriptor list */ 1139 1139 }; 1140 1140 1141 1141 /* ··· 1148 1148 * and desc_list_len fields. 1149 1149 */ 1150 1150 struct fc_els_lsri_desc lsri; 1151 - struct fc_tlv_desc desc[0]; /* Supported Descriptor list */ 1151 + struct fc_tlv_desc desc[]; /* Supported Descriptor list */ 1152 1152 }; 1153 1153 1154 1154 ··· 1231 1231 * Size of ELS excluding edc_cmd, 1232 1232 * edc_zero and desc_len fields. 1233 1233 */ 1234 - struct fc_tlv_desc desc[0]; 1234 + struct fc_tlv_desc desc[]; 1235 1235 /* Diagnostic Descriptor list */ 1236 1236 }; 1237 1237 ··· 1245 1245 * and desc_list_len fields. 1246 1246 */ 1247 1247 struct fc_els_lsri_desc lsri; 1248 - struct fc_tlv_desc desc[0]; 1248 + struct fc_tlv_desc desc[]; 1249 1249 /* Supported Diagnostic Descriptor list */ 1250 1250 }; 1251 1251
+1 -1
include/uapi/scsi/scsi_bsg_fc.h
··· 209 209 __u64 vendor_id; 210 210 211 211 /* start of vendor command area */ 212 - __u32 vendor_cmd[0]; 212 + __u32 vendor_cmd[]; 213 213 }; 214 214 215 215 /* Response:
+1 -1
include/uapi/sound/asound.h
··· 1106 1106 struct snd_ctl_tlv { 1107 1107 unsigned int numid; /* control element numeric identification */ 1108 1108 unsigned int length; /* in bytes aligned to 4 */ 1109 - unsigned int tlv[0]; /* first TLV */ 1109 + unsigned int tlv[]; /* first TLV */ 1110 1110 }; 1111 1111 1112 1112 #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
+3 -3
include/uapi/sound/firewire.h
··· 38 38 __be32 category; 39 39 __be32 command; 40 40 __be32 status; 41 - __be32 params[0]; 41 + __be32 params[]; 42 42 }; 43 43 struct snd_firewire_event_efw_response { 44 44 unsigned int type; 45 - __be32 response[0]; /* some responses */ 45 + __be32 response[]; /* some responses */ 46 46 }; 47 47 48 48 struct snd_firewire_event_digi00x_message { ··· 63 63 64 64 struct snd_firewire_event_tascam_control { 65 65 unsigned int type; 66 - struct snd_firewire_tascam_change changes[0]; 66 + struct snd_firewire_tascam_change changes[]; 67 67 }; 68 68 69 69 struct snd_firewire_event_motu_register_dsp_change {
+1 -1
include/uapi/sound/skl-tplg-interface.h
··· 151 151 __u32 rsvd:30; 152 152 __u32 param_id; 153 153 __u32 max; 154 - char params[0]; 154 + char params[]; 155 155 } __packed; 156 156 157 157 enum skl_tkn_dir {
+1 -1
include/uapi/sound/sof/header.h
··· 23 23 __u32 size; /**< size in bytes of data excl. this struct */ 24 24 __u32 abi; /**< SOF ABI version */ 25 25 __u32 reserved[4]; /**< reserved for future use */ 26 - __u32 data[0]; /**< Component data - opaque to core */ 26 + __u32 data[]; /**< Component data - opaque to core */ 27 27 } __packed; 28 28 29 29 #endif
+1 -1
include/uapi/sound/usb_stream.h
··· 61 61 unsigned inpacket_split_at; 62 62 unsigned next_inpacket_split; 63 63 unsigned next_inpacket_split_at; 64 - struct usb_stream_packet inpacket[0]; 64 + struct usb_stream_packet inpacket[]; 65 65 }; 66 66 67 67 enum usb_stream_state {
+6 -6
tools/arch/x86/include/uapi/asm/kvm.h
··· 198 198 __u32 nmsrs; /* number of msrs in entries */ 199 199 __u32 pad; 200 200 201 - struct kvm_msr_entry entries[0]; 201 + struct kvm_msr_entry entries[]; 202 202 }; 203 203 204 204 /* for KVM_GET_MSR_INDEX_LIST */ 205 205 struct kvm_msr_list { 206 206 __u32 nmsrs; /* number of msrs in entries */ 207 - __u32 indices[0]; 207 + __u32 indices[]; 208 208 }; 209 209 210 210 /* Maximum size of any access bitmap in bytes */ ··· 241 241 struct kvm_cpuid { 242 242 __u32 nent; 243 243 __u32 padding; 244 - struct kvm_cpuid_entry entries[0]; 244 + struct kvm_cpuid_entry entries[]; 245 245 }; 246 246 247 247 struct kvm_cpuid_entry2 { ··· 263 263 struct kvm_cpuid2 { 264 264 __u32 nent; 265 265 __u32 padding; 266 - struct kvm_cpuid_entry2 entries[0]; 266 + struct kvm_cpuid_entry2 entries[]; 267 267 }; 268 268 269 269 /* for KVM_GET_PIT and KVM_SET_PIT */ ··· 389 389 * the contents of CPUID leaf 0xD on the host. 390 390 */ 391 391 __u32 region[1024]; 392 - __u32 extra[0]; 392 + __u32 extra[]; 393 393 }; 394 394 395 395 #define KVM_MAX_XCRS 16 ··· 515 515 __u32 fixed_counter_bitmap; 516 516 __u32 flags; 517 517 __u32 pad[4]; 518 - __u64 events[0]; 518 + __u64 events[]; 519 519 }; 520 520 521 521 #define KVM_PMU_EVENT_ALLOW 0
+3 -3
tools/include/uapi/drm/i915_drm.h
··· 2060 2060 2061 2061 __u64 mbz64; /* reserved for future use; must be zero */ 2062 2062 2063 - struct i915_engine_class_instance engines[0]; 2063 + struct i915_engine_class_instance engines[]; 2064 2064 } __attribute__((packed)); 2065 2065 2066 2066 #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \ ··· 2098 2098 __u64 flags; /* all undefined flags must be zero */ 2099 2099 __u64 mbz64[4]; /* reserved for future use; must be zero */ 2100 2100 2101 - struct i915_engine_class_instance engines[0]; 2101 + struct i915_engine_class_instance engines[]; 2102 2102 } __attribute__((packed)); 2103 2103 2104 2104 #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \ ··· 2225 2225 * length = width (i) * num_siblings (j) 2226 2226 * index = j + i * num_siblings 2227 2227 */ 2228 - struct i915_engine_class_instance engines[0]; 2228 + struct i915_engine_class_instance engines[]; 2229 2229 2230 2230 } __packed; 2231 2231
+1 -1
tools/include/uapi/linux/fs.h
··· 90 90 __u16 dest_count; /* in - total elements in info array */ 91 91 __u16 reserved1; /* must be zero */ 92 92 __u32 reserved2; /* must be zero */ 93 - struct file_dedupe_range_info info[0]; 93 + struct file_dedupe_range_info info[]; 94 94 }; 95 95 96 96 /* And dynamically-tunable limits and defaults: */
+1 -1
tools/include/uapi/linux/if_tun.h
··· 108 108 struct tun_filter { 109 109 __u16 flags; /* TUN_FLT_ flags see above */ 110 110 __u16 count; /* Number of addresses */ 111 - __u8 addr[0][ETH_ALEN]; 111 + __u8 addr[][ETH_ALEN]; 112 112 }; 113 113 114 114 #endif /* _UAPI__IF_TUN_H */
+4 -4
tools/include/uapi/linux/kvm.h
··· 539 539 540 540 struct kvm_coalesced_mmio_ring { 541 541 __u32 first, last; 542 - struct kvm_coalesced_mmio coalesced_mmio[0]; 542 + struct kvm_coalesced_mmio coalesced_mmio[]; 543 543 }; 544 544 545 545 #define KVM_COALESCED_MMIO_MAX \ ··· 618 618 /* for KVM_SET_SIGNAL_MASK */ 619 619 struct kvm_signal_mask { 620 620 __u32 len; 621 - __u8 sigset[0]; 621 + __u8 sigset[]; 622 622 }; 623 623 624 624 /* for KVM_TPR_ACCESS_REPORTING */ ··· 1216 1216 struct kvm_irq_routing { 1217 1217 __u32 nr; 1218 1218 __u32 flags; 1219 - struct kvm_irq_routing_entry entries[0]; 1219 + struct kvm_irq_routing_entry entries[]; 1220 1220 }; 1221 1221 1222 1222 #endif ··· 1335 1335 1336 1336 struct kvm_reg_list { 1337 1337 __u64 n; /* number of regs */ 1338 - __u64 reg[0]; 1338 + __u64 reg[]; 1339 1339 }; 1340 1340 1341 1341 struct kvm_one_reg {
+1 -1
tools/include/uapi/linux/perf_event.h
··· 491 491 /* 492 492 * User provided buffer to store program ids 493 493 */ 494 - __u32 ids[0]; 494 + __u32 ids[]; 495 495 }; 496 496 497 497 /*
+2 -2
tools/include/uapi/linux/pkt_cls.h
··· 180 180 181 181 short hoff; 182 182 __be32 hmask; 183 - struct tc_u32_key keys[0]; 183 + struct tc_u32_key keys[]; 184 184 }; 185 185 186 186 struct tc_u32_mark { ··· 192 192 struct tc_u32_pcnt { 193 193 __u64 rcnt; 194 194 __u64 rhit; 195 - __u64 kcnts[0]; 195 + __u64 kcnts[]; 196 196 }; 197 197 198 198 /* Flags */
+2 -2
tools/include/uapi/linux/seg6.h
··· 30 30 __u8 flags; 31 31 __u16 tag; 32 32 33 - struct in6_addr segments[0]; 33 + struct in6_addr segments[]; 34 34 }; 35 35 36 36 #define SR6_FLAG1_PROTECTED (1 << 6) ··· 49 49 struct sr6_tlv { 50 50 __u8 type; 51 51 __u8 len; 52 - __u8 data[0]; 52 + __u8 data[]; 53 53 }; 54 54 55 55 #endif
+2 -2
tools/include/uapi/linux/usbdevice_fs.h
··· 131 131 unsigned int signr; /* signal to be sent on completion, 132 132 or 0 if none should be sent. */ 133 133 void __user *usercontext; 134 - struct usbdevfs_iso_packet_desc iso_frame_desc[0]; 134 + struct usbdevfs_iso_packet_desc iso_frame_desc[]; 135 135 }; 136 136 137 137 /* ioctls for talking directly to drivers */ ··· 176 176 struct usbdevfs_streams { 177 177 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */ 178 178 unsigned int num_eps; 179 - unsigned char eps[0]; 179 + unsigned char eps[]; 180 180 }; 181 181 182 182 /*
+1 -1
tools/include/uapi/sound/asound.h
··· 1106 1106 struct snd_ctl_tlv { 1107 1107 unsigned int numid; /* control element numeric identification */ 1108 1108 unsigned int length; /* in bytes aligned to 4 */ 1109 - unsigned int tlv[0]; /* first TLV */ 1109 + unsigned int tlv[]; /* first TLV */ 1110 1110 }; 1111 1111 1112 1112 #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)