[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250611-iio-zero-init-stack-with-instead-of-memset-v1-19-ebb2d0a24302@baylibre.com>
Date: Wed, 11 Jun 2025 17:39:11 -0500
From: David Lechner <dlechner@...libre.com>
To: Michael Hennerich <michael.hennerich@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>, Jonathan Cameron <jic23@...nel.org>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Heiko Stuebner <heiko@...ech.de>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Francesco Dolcini <francesco@...cini.it>,
João Paulo Gonçalves <jpaulo.silvagoncalves@...il.com>,
Leonard Göhrs <l.goehrs@...gutronix.de>,
kernel@...gutronix.de, Oleksij Rempel <o.rempel@...gutronix.de>,
Roan van Dijk <roan@...tonic.nl>,
Tomasz Duszynski <tomasz.duszynski@...akon.com>,
Jacopo Mondi <jacopo@...ndi.org>,
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@....com>,
Mudit Sharma <muditsharma.info@...il.com>,
Javier Carrasco <javier.carrasco.cruz@...il.com>,
Ondřej Jirman <megi@....cz>,
Andreas Klinger <ak@...klinger.de>,
Petre Rodan <petre.rodan@...dimension.ro>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
David Lechner <dlechner@...libre.com>
Subject: [PATCH 19/28] iio: light: ltr501: use = { } instead of memset()
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@...libre.com>
---
drivers/iio/light/ltr501.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index db0cc3642bd8010358de8515c24337d7385bce38..c14767472fbe8620ad59c8417d2ceff14f9485a6 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1279,14 +1279,12 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
struct {
u16 channels[3];
aligned_s64 ts;
- } scan;
+ } scan = { };
__le16 als_buf[2];
u8 mask = 0;
int j = 0;
int ret, psdata;
- memset(&scan, 0, sizeof(scan));
-
/* figure out which data needs to be ready */
if (test_bit(0, indio_dev->active_scan_mask) ||
test_bit(1, indio_dev->active_scan_mask))
--
2.43.0
Powered by blists - more mailing lists