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
parent
f646c99ade
commit
174818e102
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue