diff options
| author | David Lechner | 2025-06-11 17:39:10 -0500 |
|---|---|---|
| committer | Jonathan Cameron | 2025-06-26 19:32:56 +0100 |
| commit | 6ee8e56aedc08baf2ce1b732d5bfe8579aa28fda (patch) | |
| tree | dea8fdfdea69ac72d23dcd92dfcb5301cc889031 /drivers | |
| parent | 3ee3c09d2d76dd30282a07aa1fb6e57c40081fed (diff) | |
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>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iio/light/bh1745.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c index 56ab5fe90ff9..4e9bd8f831f7 100644 --- a/drivers/iio/light/bh1745.c +++ b/drivers/iio/light/bh1745.c @@ -740,14 +740,12 @@ static irqreturn_t bh1745_trigger_handler(int interrupt, void *p) struct { u16 chans[4]; aligned_s64 timestamp; - } scan; + } scan = { }; u16 value; int ret; int i; int j = 0; - memset(&scan, 0, sizeof(scan)); - iio_for_each_active_channel(indio_dev, i) { ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i, &value, 2); |
