]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: mt6360-adc: use = { } instead of memset()
authorDavid Lechner <dlechner@baylibre.com>
Wed, 11 Jun 2025 22:38:56 +0000 (17:38 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 26 Jun 2025 18:32:55 +0000 (19:32 +0100)
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>
drivers/iio/adc/mt6360-adc.c

index f8e98b6fa7e923c6b73bedf9ca1c466e7a9c3c47..69b3569c90e5b665e1d2c59621df00d6142fbe9c 100644 (file)
@@ -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) {