aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-06-11 17:39:18 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-06-26 19:32:57 +0100
commitca2ec0786009fd92245a4b8ec79b685a3906e774 (patch)
treee595d36c3e2d837a36d7f2fab2bd075ba293c56c
parentiio: pressure: mprls0025pa: use = { } instead of memset() (diff)
downloadlinux-ca2ec0786009fd92245a4b8ec79b685a3906e774.tar.gz
linux-ca2ec0786009fd92245a4b8ec79b685a3906e774.zip
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>
-rw-r--r--drivers/iio/pressure/zpa2326.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
index 1640aa3717ed..6eef37c0952d 100644
--- a/drivers/iio/pressure/zpa2326.c
+++ b/drivers/iio/pressure/zpa2326.c
@@ -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);