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

index 6ff47415a2221436b1fd548aa0bc070ba5fbb774..ad9738228b7f2db3f3b6cfc01fd97e43b579b687 100644 (file)
@@ -645,12 +645,10 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p)
        struct {
                u16 vals[RTQ6056_MAX_CHANNEL];
                aligned_s64 timestamp;
-       } data;
+       } data = { };
        unsigned int raw;
        int i = 0, bit, ret;
 
-       memset(&data, 0, sizeof(data));
-
        pm_runtime_get_sync(dev);
 
        iio_for_each_active_channel(indio_dev, bit) {