Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: magnetometer: af8133j: 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-22-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
174818e1 f646c99a

+1 -3
+1 -3
drivers/iio/magnetometer/af8133j.c
··· 361 361 struct { 362 362 __le16 values[3]; 363 363 aligned_s64 timestamp; 364 - } sample; 364 + } sample = { }; 365 365 int ret; 366 - 367 - memset(&sample, 0, sizeof(sample)); 368 366 369 367 ret = af8133j_read_measurement(data, sample.values); 370 368 if (ret)