[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFj5m9L-=DL-bB9iKRkAdVB+Jjdb5LaF12K1hfj5SCKmii1gXw@mail.gmail.com>
Date: Thu, 20 Oct 2022 09:26:12 +0800
From: Ming Lei <ming.lei@...hat.com>
To: zys.zljxml@...il.com
Cc: axboe@...nel.dk, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Yushan Zhou <katrinzhou@...cent.com>
Subject: Re: [PATCH] ublk_drv: use flexible-array member instead of
zero-length array
On Tue, Oct 18, 2022 at 6:02 PM <zys.zljxml@...il.com> wrote:
>
> From: Yushan Zhou <katrinzhou@...cent.com>
>
> Eliminate the following coccicheck warning:
> ./drivers/block/ublk_drv.c:127:16-19: WARNING use flexible-array member instead
>
> Signed-off-by: Yushan Zhou <katrinzhou@...cent.com>
> ---
> drivers/block/ublk_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 2651bf41dde3..5afce6ffaadf 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -124,7 +124,7 @@ struct ublk_queue {
> bool force_abort;
> unsigned short nr_io_ready; /* how many ios setup */
> struct ublk_device *dev;
> - struct ublk_io ios[0];
> + struct ublk_io ios[];
> };
>
> #define UBLK_DAEMON_MONITOR_PERIOD (5 * HZ)
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Thanks,
Ming
Powered by blists - more mailing lists