Skip to content

Commit 53760f9

Browse files
committed
Merge tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
Pull more flexible-array member conversions from Gustavo A. R. Silva: "Replace zero-length arrays with flexible-array members" * tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: printk: ringbuffer: Replace zero-length array with flexible-array member net/smc: Replace zero-length array with flexible-array member net/mlx5: Replace zero-length array with flexible-array member mei: hw: Replace zero-length array with flexible-array member gve: Replace zero-length array with flexible-array member Bluetooth: btintel: Replace zero-length array with flexible-array member scsi: target: tcmu: Replace zero-length array with flexible-array member ima: Replace zero-length array with flexible-array member enetc: Replace zero-length array with flexible-array member fs: Replace zero-length array with flexible-array member Bluetooth: Replace zero-length array with flexible-array member params: Replace zero-length array with flexible-array member tracepoint: Replace zero-length array with flexible-array member platform/chrome: cros_ec_proto: Replace zero-length array with flexible-array member platform/chrome: cros_ec_commands: Replace zero-length array with flexible-array member mailbox: zynqmp-ipi-message: Replace zero-length array with flexible-array member dmaengine: ti-cppi5: Replace zero-length array with flexible-array member
2 parents bb3540b + a38283d commit 53760f9

23 files changed

Lines changed: 40 additions & 40 deletions

File tree

drivers/bluetooth/btintel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum {
4747
struct intel_tlv {
4848
u8 type;
4949
u8 len;
50-
u8 val[0];
50+
u8 val[];
5151
} __packed;
5252

5353
struct intel_version_tlv {

drivers/misc/mei/hw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ struct mei_ext_hdr {
224224
u8 type;
225225
u8 length;
226226
u8 ext_payload[2];
227-
u8 hdr[0];
227+
u8 hdr[];
228228
};
229229

230230
/**
@@ -238,7 +238,7 @@ struct mei_ext_meta_hdr {
238238
u8 count;
239239
u8 size;
240240
u8 reserved[2];
241-
struct mei_ext_hdr hdrs[0];
241+
struct mei_ext_hdr hdrs[];
242242
};
243243

244244
/*
@@ -308,7 +308,7 @@ struct mei_msg_hdr {
308308
u32 dma_ring:1;
309309
u32 internal:1;
310310
u32 msg_complete:1;
311-
u32 extension[0];
311+
u32 extension[];
312312
} __packed;
313313

314314
/* The length is up to 9 bits */

drivers/net/ethernet/freescale/enetc/enetc_qos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ struct enetc_psfp_gate {
402402
u32 num_entries;
403403
refcount_t refcount;
404404
struct hlist_node node;
405-
struct action_gate_entry entries[0];
405+
struct action_gate_entry entries[];
406406
};
407407

408408
/* Only enable the green color frame now

drivers/net/ethernet/google/gve/gve_adminq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static_assert(sizeof(struct stats) == 16);
198198

199199
struct gve_stats_report {
200200
__be64 written_count;
201-
struct stats stats[0];
201+
struct stats stats[];
202202
};
203203

204204
static_assert(sizeof(struct gve_stats_report) == 8);

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ static int gve_alloc_stats_report(struct gve_priv *priv)
116116
priv->tx_cfg.num_queues;
117117
rx_stats_num = (GVE_RX_STATS_REPORT_NUM + NIC_RX_STATS_REPORT_NUM) *
118118
priv->rx_cfg.num_queues;
119-
priv->stats_report_len = sizeof(struct gve_stats_report) +
120-
(tx_stats_num + rx_stats_num) *
121-
sizeof(struct stats);
119+
priv->stats_report_len = struct_size(priv->stats_report, stats,
120+
tx_stats_num + rx_stats_num);
122121
priv->stats_report =
123122
dma_alloc_coherent(&priv->pdev->dev, priv->stats_report_len,
124123
&priv->stats_report_bus, GFP_KERNEL);

drivers/target/target_core_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct tcmu_tmr {
194194

195195
uint8_t tmr_type;
196196
uint32_t tmr_cmd_cnt;
197-
int16_t tmr_cmd_ids[0];
197+
int16_t tmr_cmd_ids[];
198198
};
199199

200200
/*

fs/binfmt_elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ struct elf_thread_core_info {
16901690
struct elf_thread_core_info *next;
16911691
struct task_struct *task;
16921692
struct elf_prstatus prstatus;
1693-
struct memelfnote notes[0];
1693+
struct memelfnote notes[];
16941694
};
16951695

16961696
struct elf_note_info {

fs/hfs/btree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct hfs_bnode {
6060
wait_queue_head_t lock_wq;
6161
atomic_t refcnt;
6262
unsigned int page_offset;
63-
struct page *page[0];
63+
struct page *page[];
6464
};
6565

6666
#define HFS_BNODE_ERROR 0

fs/hfsplus/hfsplus_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct hfs_bnode {
117117
wait_queue_head_t lock_wq;
118118
atomic_t refcnt;
119119
unsigned int page_offset;
120-
struct page *page[0];
120+
struct page *page[];
121121
};
122122

123123
#define HFS_BNODE_LOCK 0

fs/isofs/rock.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct SU_ER_s {
2222
__u8 len_des;
2323
__u8 len_src;
2424
__u8 ext_ver;
25-
__u8 data[0];
25+
__u8 data[];
2626
} __attribute__ ((packed));
2727

2828
struct RR_RR_s {
@@ -44,7 +44,7 @@ struct RR_PN_s {
4444
struct SL_component {
4545
__u8 flags;
4646
__u8 len;
47-
__u8 text[0];
47+
__u8 text[];
4848
} __attribute__ ((packed));
4949

5050
struct RR_SL_s {
@@ -54,7 +54,7 @@ struct RR_SL_s {
5454

5555
struct RR_NM_s {
5656
__u8 flags;
57-
char name[0];
57+
char name[];
5858
} __attribute__ ((packed));
5959

6060
struct RR_CL_s {
@@ -71,7 +71,7 @@ struct stamp {
7171

7272
struct RR_TF_s {
7373
__u8 flags;
74-
struct stamp times[0]; /* Variable number of these beasts */
74+
struct stamp times[]; /* Variable number of these beasts */
7575
} __attribute__ ((packed));
7676

7777
/* Linux-specific extension for transparent decompression */

0 commit comments

Comments
 (0)