Added new macros to overflow.h and reuse it in IIO. For the sake of examples a few more places were updated (requested by Kees). In case maintainers are okay, tags will be appreciated. v4: - dropped applied patches - refactored macros and code to make them simpler (Jonathan) - moved (renamed) macros to overflow.h v3: https://lore.kernel.org/r/20230724110204.46285-1-andriy.shevchenko@xxxxxxxxxxxxxxx - dropped applied patches - use switch-case for the supported clocks (Jonathan) - redone opaque_struct_size() to be simpler (Uwe) - dropped wrong hunk for krealloc_array() conversion (Jonathan) - dropped initcall move (Jonathan) v2: - sprintf() --> sysfs_emit() (Nuno) - added tag (Nuno) Andy Shevchenko (8): overflow: Use POD in check_shl_overflow() overflow: Add struct_size_with_data() and struct_data_pointer() helpers iio: core: NULLify private pointer when there is no private data iio: core: Calculate alloc_size only once in iio_device_alloc() iio: core: Use new helpers from overflow.h in iio_device_alloc() spi: Use new helpers from overflow.h in __spi_alloc_controller() net-device: Use new helpers from overflow.h in netdevice APIs dmaengine: ste_dma40: Use new helpers from overflow.h drivers/dma/ste_dma40.c | 12 ++++++------ drivers/iio/industrialio-core.c | 16 +++++++++------- drivers/spi/spi.c | 6 +++--- include/linux/netdevice.h | 3 ++- include/linux/overflow.h | 29 +++++++++++++++++++++++++++-- net/core/dev.c | 10 +++++----- 6 files changed, 52 insertions(+), 24 deletions(-) -- 2.43.0.rc1.1.gbec44491f096