Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Lechner and committed by
Jonathan Cameron
ca2ec078 73f31d9f

+1 -3
+1 -3
drivers/iio/pressure/zpa2326.c
··· 583 583 u32 pressure; 584 584 u16 temperature; 585 585 aligned_s64 timestamp; 586 - } sample; 586 + } sample = { }; 587 587 int err; 588 - 589 - memset(&sample, 0, sizeof(sample)); 590 588 591 589 if (test_bit(0, indio_dev->active_scan_mask)) { 592 590 /* Get current pressure from hardware FIFO. */