Skip to content

Commit bda9a9c

Browse files
dlechjic23
authored andcommitted
iio: pressure: zpa2326: 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-26-ebb2d0a24302@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 40fae6d commit bda9a9c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/iio/pressure/zpa2326.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,9 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
583583
u32 pressure;
584584
u16 temperature;
585585
aligned_s64 timestamp;
586-
} sample;
586+
} sample = { };
587587
int err;
588588

589-
memset(&sample, 0, sizeof(sample));
590-
591589
if (test_bit(0, indio_dev->active_scan_mask)) {
592590
/* Get current pressure from hardware FIFO. */
593591
err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);

0 commit comments

Comments
 (0)