[PATCH 00/28] iio: zero init stack with { } instead of memset()

Andy Shevchenko andriy.shevchenko at linux.intel.com
Thu Jun 12 05:51:09 PDT 2025


On Wed, Jun 11, 2025 at 05:38:52PM -0500, David Lechner wrote:
> Jonathan mentioned recently that he would like to get away from using
> memset() to zero-initialize stack memory in the IIO subsystem. And we
> have it on good authority that initializing a struct or array with = { }
> is the preferred way to do this in the kernel [1]. So here is a series
> to take care of that.

I believe we may do that independently of the compilers that can leave garbage
in the padding. In case it happens, it will be good adventure to fix the bugs
in the code, that for some reason take padding(s) into account for the real
values.

Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list