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: temperature: tmp006: 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-28-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
8540a6f9 88bcfc9e

+1 -3
+1 -3
drivers/iio/temperature/tmp006.c
··· 254 254 struct { 255 255 s16 channels[2]; 256 256 aligned_s64 ts; 257 - } scan; 257 + } scan = { }; 258 258 s32 ret; 259 - 260 - memset(&scan, 0, sizeof(scan)); 261 259 262 260 ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT); 263 261 if (ret < 0)