Commit 466f966b authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

dmaengine: Replace zero-length array with flexible-array

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].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://github.com/KSPP/linux/issues/21Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
parent 06f3a5a4
...@@ -77,7 +77,7 @@ struct milbeaut_hdmac_device { ...@@ -77,7 +77,7 @@ struct milbeaut_hdmac_device {
struct dma_device ddev; struct dma_device ddev;
struct clk *clk; struct clk *clk;
void __iomem *reg_base; void __iomem *reg_base;
struct milbeaut_hdmac_chan channels[0]; struct milbeaut_hdmac_chan channels[];
}; };
static struct milbeaut_hdmac_chan * static struct milbeaut_hdmac_chan *
......
...@@ -74,7 +74,7 @@ struct milbeaut_xdmac_chan { ...@@ -74,7 +74,7 @@ struct milbeaut_xdmac_chan {
struct milbeaut_xdmac_device { struct milbeaut_xdmac_device {
struct dma_device ddev; struct dma_device ddev;
void __iomem *reg_base; void __iomem *reg_base;
struct milbeaut_xdmac_chan channels[0]; struct milbeaut_xdmac_chan channels[];
}; };
static struct milbeaut_xdmac_chan * static struct milbeaut_xdmac_chan *
......
...@@ -127,7 +127,7 @@ struct moxart_desc { ...@@ -127,7 +127,7 @@ struct moxart_desc {
unsigned int dma_cycles; unsigned int dma_cycles;
struct virt_dma_desc vd; struct virt_dma_desc vd;
uint8_t es; uint8_t es;
struct moxart_sg sg[0]; struct moxart_sg sg[];
}; };
struct moxart_chan { struct moxart_chan {
......
...@@ -211,7 +211,7 @@ struct edma_desc { ...@@ -211,7 +211,7 @@ struct edma_desc {
u32 residue; u32 residue;
u32 residue_stat; u32 residue_stat;
struct edma_pset pset[0]; struct edma_pset pset[];
}; };
struct edma_cc; struct edma_cc;
......
...@@ -170,7 +170,7 @@ struct udma_desc { ...@@ -170,7 +170,7 @@ struct udma_desc {
void *metadata; /* pointer to provided metadata buffer (EPIP, PSdata) */ void *metadata; /* pointer to provided metadata buffer (EPIP, PSdata) */
unsigned int hwdesc_count; unsigned int hwdesc_count;
struct udma_hwdesc hwdesc[0]; struct udma_hwdesc hwdesc[];
}; };
enum udma_chan_state { enum udma_chan_state {
......
...@@ -88,7 +88,7 @@ struct timb_dma { ...@@ -88,7 +88,7 @@ struct timb_dma {
struct dma_device dma; struct dma_device dma;
void __iomem *membase; void __iomem *membase;
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
struct timb_dma_chan channels[0]; struct timb_dma_chan channels[];
}; };
static struct device *chan2dev(struct dma_chan *chan) static struct device *chan2dev(struct dma_chan *chan)
......
...@@ -153,7 +153,7 @@ struct dma_interleaved_template { ...@@ -153,7 +153,7 @@ struct dma_interleaved_template {
bool dst_sgl; bool dst_sgl;
size_t numf; size_t numf;
size_t frame_size; size_t frame_size;
struct data_chunk sgl[0]; struct data_chunk sgl[];
}; };
/** /**
...@@ -535,7 +535,7 @@ struct dmaengine_unmap_data { ...@@ -535,7 +535,7 @@ struct dmaengine_unmap_data {
struct device *dev; struct device *dev;
struct kref kref; struct kref kref;
size_t len; size_t len;
dma_addr_t addr[0]; dma_addr_t addr[];
}; };
struct dma_async_tx_descriptor; struct dma_async_tx_descriptor;
......
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