summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-06-11 17:38:56 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-06-26 19:32:55 +0100
commitb8f008100a34eb282dc0cf6c13383ff0d177a533 (patch)
tree326a684593bdc47a52020ae775d4479d04ada87d
parent3a780d29aece36f584360c1cac5fb50c7bdc0f39 (diff)
downloadlinux-b8f008100a34eb282dc0cf6c13383ff0d177a533.tar.gz
linux-b8f008100a34eb282dc0cf6c13383ff0d177a533.zip
iio: adc: mt6360-adc: 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-4-ebb2d0a24302@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/mt6360-adc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
index f8e98b6fa7e9..69b3569c90e5 100644
--- a/drivers/iio/adc/mt6360-adc.c
+++ b/drivers/iio/adc/mt6360-adc.c
@@ -264,10 +264,9 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p)
struct {
u16 values[MT6360_CHAN_MAX];
aligned_s64 timestamp;
- } data;
+ } data = { };
int i = 0, bit, val, ret;
- memset(&data, 0, sizeof(data));
iio_for_each_active_channel(indio_dev, bit) {
ret = mt6360_adc_read_channel(mad, bit, &val);
if (ret < 0) {