[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200501073256.GA23452@lst.de>
Date: Fri, 1 May 2020 09:32:56 +0200
From: Christoph Hellwig <hch@....de>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org,
James Smart <james.smart@...adcom.com>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Israel Rukshin <israelr@...lanox.com>,
Max Gurtovoy <maxg@...lanox.com>,
Ming Lei <ming.lei@...hat.com>, Hannes Reinecke <hare@...e.de>,
linux-nvme@...ts.infradead.org
Subject: Re: [PATCH 15/15] nvme: avoid gcc-10 zero-length-bounds warning
On Thu, Apr 30, 2020 at 11:30:57PM +0200, Arnd Bergmann wrote:
> When CONFIG_ARCH_NO_SG_CHAIN is set, op->sgl[0] cannot be dereferenced,
> as gcc-10 now points out:
>
> drivers/nvme/host/fc.c: In function 'nvme_fc_init_request':
> drivers/nvme/host/fc.c:1774:29: warning: array subscript 0 is outside the bounds of an interior zero-length array 'struct scatterlist[0]' [-Wzero-length-bounds]
> 1774 | op->op.fcp_req.first_sgl = &op->sgl[0];
> | ^~~~~~~~~~~
> drivers/nvme/host/fc.c:98:21: note: while referencing 'sgl'
> 98 | struct scatterlist sgl[NVME_INLINE_SG_CNT];
> | ^~~
>
> I don't know if this is a legitimate warning or a false-positive.
> If this is just a false alarm, the warning is easily suppressed
> by interpreting the array as a pointer.
This looks like a surpression to be, but then again I find the new
code actually cleaner, so I'm fine with it :)
Powered by blists - more mailing lists