Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: veml6030: use = { } instead of memset()

Use { } instead of memset() to zero-initialize stack memory to simplify
the code.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Tested-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250611-iio-zero-init-stack-with-instead-of-memset-v1-21-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
f646c99a acddd609

+1 -3
+1 -3
drivers/iio/light/veml6030.c
··· 892 892 struct { 893 893 u16 chans[2]; 894 894 aligned_s64 timestamp; 895 - } scan; 896 - 897 - memset(&scan, 0, sizeof(scan)); 895 + } scan = { }; 898 896 899 897 iio_for_each_active_channel(iio, ch) { 900 898 ret = regmap_read(data->regmap, VEML6030_REG_DATA(ch),