spi: Don't use flexible array in struct spi_message definition
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 10 Oct 2023 16:31:00 +0000 (19:31 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 11 Oct 2023 16:10:54 +0000 (17:10 +0100)
commitf6d7f050e258e3c71e310f5167c4d65bbefaeb31
tree0c63df0e0e8c8e98e050db8f3821757d6268b18e
parent8097dbd4b631b1f4cfe3def909f828b071d99ad7
spi: Don't use flexible array in struct spi_message definition

The struct spi_message can be embedded into another structures.
With that the flexible array might be problematic as sparse
complains about it, although there is no real issue in the code
because when the message is embedded it doesn't use flexible array
member. That memeber is a private to spi_message_alloc() API, so
move it to that API in a form of an inherited data type.

Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Fixes: 75e308ffc4f0 ("spi: Use struct_size() helper"))
Closes: https://lore.kernel.org/r/20231009-onshore-underage-c58415adfd92-mkl@pengutronix.de
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/r/20231010163100.89734-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/spi/spi.h