Skip to content

Commit 7461179

Browse files
dlechjic23
authored andcommitted
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>
1 parent 5473e53 commit 7461179

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/iio/temperature/tmp006.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,9 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p)
254254
struct {
255255
s16 channels[2];
256256
aligned_s64 ts;
257-
} scan;
257+
} scan = { };
258258
s32 ret;
259259

260-
memset(&scan, 0, sizeof(scan));
261-
262260
ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT);
263261
if (ret < 0)
264262
goto err;

0 commit comments

Comments
 (0)