nvme-pci: use struct_size for allocation struct nvme_dev
authorChristoph Hellwig <hch@lst.de>
Mon, 12 May 2025 15:20:44 +0000 (17:20 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 20 May 2025 03:34:27 +0000 (05:34 +0200)
commitde65e642644a20576af4e9d88fcbd911766c6b57
treec1876b933bf593fd3f87eebf0a7ac31b00a794d0
parentf01e389e88b27a55674bc11d5d44dc75f0d83745
nvme-pci: use struct_size for allocation struct nvme_dev

This avoids open coding the variable size array arithmetics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Leon Romanovsky <leon@kernel.org>
drivers/nvme/host/pci.c