nvmet: use flex_array_size and struct_size
authorLen Baker <len.baker@gmx.com>
Sun, 24 Oct 2021 17:29:21 +0000 (19:29 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 27 Oct 2021 06:06:41 +0000 (08:06 +0200)
commitd156cfcafbd0eae4224ea007d95ebda467eb0c46
treec48d56c067bde50fa8a609760ff4e8b9303921c0
parent2953b30b1d9feb1bc555682e64e6479d197b9231
nvmet: use flex_array_size and struct_size

In an effort to avoid open-coded arithmetic in the kernel [1], use the
flex_array_size() and struct_size() helpers instead of an open-coded
calculation.

[1] https://github.com/KSPP/linux/issues/160

Signed-off-by: Len Baker <len.baker@gmx.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/multipath.c
drivers/nvme/target/admin-cmd.c