summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-06-11 17:39:07 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-06-26 19:32:56 +0100
commit46868e362f2a48edd44e924c036c52f199b9103c (patch)
treedaaba1a1865f7873d35381a98beb0648e0d82a51
parentd2614c43af75653ab9d06d800857d3f9662ceb3a (diff)
iio: dac: ad3552r: use = { } instead of memset()
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-15-ebb2d0a24302@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/dac/ad3552r.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index a44b163f3183..93c33bc3e1be 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -293,10 +293,9 @@ static irqreturn_t ad3552r_trigger_handler(int irq, void *p)
struct iio_buffer *buf = indio_dev->buffer;
struct ad3552r_desc *dac = iio_priv(indio_dev);
/* Maximum size of a scan */
- u8 buff[AD3552R_MAX_CH * AD3552R_MAX_REG_SIZE];
+ u8 buff[AD3552R_MAX_CH * AD3552R_MAX_REG_SIZE] = { };
int err;
- memset(buff, 0, sizeof(buff));
err = iio_pop_from_buffer(buf, buff);
if (err)
goto end;