Skip to content

Commit 5473e53

Browse files
dlechjic23
authored andcommitted
iio: proximity: irsd200: 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-27-ebb2d0a24302@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent bda9a9c commit 5473e53

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/iio/proximity/irsd200.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,9 @@ static irqreturn_t irsd200_trigger_handler(int irq, void *pollf)
763763
struct {
764764
s16 channel;
765765
aligned_s64 ts;
766-
} scan;
766+
} scan = { };
767767
int ret;
768768

769-
memset(&scan, 0, sizeof(scan));
770769
ret = irsd200_read_data(data, &scan.channel);
771770
if (ret)
772771
goto end;

0 commit comments

Comments
 (0)