spi: Use struct_size() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 14 Jul 2023 09:17:48 +0000 (12:17 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 14 Jul 2023 13:44:39 +0000 (14:44 +0100)
commit75e308ffc4f0d36b895f1110ece8b77d4116fdb1
tree3c3f612b0c248bcc5740b0376fc6effed9081fe8
parent169f5312dc46deb986e368b6828bedbedd297f6e
spi: Use struct_size() helper

The Documentation/process/deprecated.rst suggests to use flexible array
members to provide a way to declare having a dynamically sized set of
trailing elements in a structure.This makes code robust agains bunch of
the issues described in the documentation, main of which is about the
correctness of the sizeof() calculation for this data structure.

Due to above, prefer struct_size() over open-coded versions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230714091748.89681-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/spi/spi.h