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

authored by

David Lechner and committed by
Jonathan Cameron
6ee8e56a 3ee3c09d

+1 -3
+1 -3
drivers/iio/light/bh1745.c
··· 740 740 struct { 741 741 u16 chans[4]; 742 742 aligned_s64 timestamp; 743 - } scan; 743 + } scan = { }; 744 744 u16 value; 745 745 int ret; 746 746 int i; 747 747 int j = 0; 748 - 749 - memset(&scan, 0, sizeof(scan)); 750 748 751 749 iio_for_each_active_channel(indio_dev, i) { 752 750 ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i,