Message ID | 20190619124555.12701-1-geert+renesas@glider.be (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | dmaengine: sh: usb-dmac: Use [] to denote a flexible array member | expand |
On Wed, Jun 19, 2019 at 02:45:55PM +0200, Geert Uytterhoeven wrote: > Flexible array members should be denoted using [] instead of [0], else > gcc will not warn when they are no longer at the end of the structure. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
On 19-06-19, 14:45, Geert Uytterhoeven wrote: > Flexible array members should be denoted using [] instead of [0], else > gcc will not warn when they are no longer at the end of the structure. Applied, thanks
diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index 0afabf395930ed94..17063aaf51bce98b 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -57,7 +57,7 @@ struct usb_dmac_desc { u32 residue; struct list_head node; dma_cookie_t done_cookie; - struct usb_dmac_sg sg[0]; + struct usb_dmac_sg sg[]; }; #define to_usb_dmac_desc(vd) container_of(vd, struct usb_dmac_desc, vd)
Flexible array members should be denoted using [] instead of [0], else gcc will not warn when they are no longer at the end of the structure. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- drivers/dma/sh/usb-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)