]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: rockchip_saradc: use = { } instead of memset()
authorDavid Lechner <dlechner@baylibre.com>
Wed, 11 Jun 2025 22:38:57 +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-5-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/rockchip_saradc.c

index 325e3747a1345c84cddcfe9a455da6ccf655447b..bd62daea0a3e5b879a8a970d107e3342fda7b8c0 100644 (file)
@@ -404,12 +404,10 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
        struct {
                u16 values[SARADC_MAX_CHANNELS];
                aligned_s64 timestamp;
-       } data;
+       } data = { };
        int ret;
        int i, j = 0;
 
-       memset(&data, 0, sizeof(data));
-
        mutex_lock(&info->lock);
 
        iio_for_each_active_channel(i_dev, i) {