iio: magnetometer: af8133j: 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-22-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
pull/1279/head
David Lechner 2025-06-11 17:39:14 -05:00 committed by Jonathan Cameron
parent f646c99ade
commit 174818e102
1 changed files with 1 additions and 3 deletions

View File

@ -361,11 +361,9 @@ static irqreturn_t af8133j_trigger_handler(int irq, void *p)
struct {
__le16 values[3];
aligned_s64 timestamp;
} sample;
} sample = { };
int ret;
memset(&sample, 0, sizeof(sample));
ret = af8133j_read_measurement(data, sample.values);
if (ret)
goto out_done;