mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-02 17:52:36 -05:00
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
73f31d9f8c
commit
ca2ec07860
@@ -583,11 +583,9 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
|
||||
u32 pressure;
|
||||
u16 temperature;
|
||||
aligned_s64 timestamp;
|
||||
} sample;
|
||||
} sample = { };
|
||||
int err;
|
||||
|
||||
memset(&sample, 0, sizeof(sample));
|
||||
|
||||
if (test_bit(0, indio_dev->active_scan_mask)) {
|
||||
/* Get current pressure from hardware FIFO. */
|
||||
err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);
|
||||
|
||||
Reference in New Issue
Block a user