IB/hfi1: Use struct_size()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 22 Jul 2023 16:47:24 +0000 (18:47 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 24 Jul 2023 11:43:12 +0000 (14:43 +0300)
commit24b1b5d85c1c1e1c0eb7b6d7b6986ecb6c80041d
treeb21d0c83e768dc5b9d5582b079d92cf2fda8b2cb
parent0b5eed06832c87275ee67f69a943d811b1fe066d
IB/hfi1: Use struct_size()

Use struct_size() instead of hand-writing it, when allocating a structure
with a flex array.

This is less verbose, more robust and more informative.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f4618a67d5ae0a30eb3f2b4558c8cc790feed79a.1690044376.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hfi1/pio.c