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: ltr501: 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>
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-19-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
19ae7344 6ee8e56a

+1 -3
+1 -3
drivers/iio/light/ltr501.c
··· 1279 1279 struct { 1280 1280 u16 channels[3]; 1281 1281 aligned_s64 ts; 1282 - } scan; 1282 + } scan = { }; 1283 1283 __le16 als_buf[2]; 1284 1284 u8 mask = 0; 1285 1285 int j = 0; 1286 1286 int ret, psdata; 1287 - 1288 - memset(&scan, 0, sizeof(scan)); 1289 1287 1290 1288 /* figure out which data needs to be ready */ 1291 1289 if (test_bit(0, indio_dev->active_scan_mask) ||