[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DAK8HUY0VT5Y.1YRMH2LOHDY8X@gmail.com>
Date: Thu, 12 Jun 2025 08:28:21 +0500
From: "Javier Carrasco" <javier.carrasco.cruz@...il.com>
To: "David Lechner" <dlechner@...libre.com>, "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>, 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>
Subject: Re: [PATCH 21/28] iio: light: veml6030: use = { } instead of
memset()
On Thu Jun 12, 2025 at 3:39 AM +05, David Lechner wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> Signed-off-by: David Lechner <dlechner@...libre.com>
> ---
> drivers/iio/light/veml6030.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
> index 473a9c3e32a3a53f373595a5113b47e795f5366c..0945f146bedbda79511e704158122acaac5e60c1 100644
> --- a/drivers/iio/light/veml6030.c
> +++ b/drivers/iio/light/veml6030.c
> @@ -892,9 +892,7 @@ static irqreturn_t veml6030_trigger_handler(int irq, void *p)
> struct {
> u16 chans[2];
> aligned_s64 timestamp;
> - } scan;
> -
> - memset(&scan, 0, sizeof(scan));
> + } scan = { };
>
> iio_for_each_active_channel(iio, ch) {
> ret = regmap_read(data->regmap, VEML6030_REG_DATA(ch),
Thank you for the patch, it looks cleaner and simpler :) I trust the
sources you provided, but I tested it with real hardware just in case.
Tested-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
Powered by blists - more mailing lists