mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
iio: accel: adxl372: 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-1-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
e564c05401
commit
f448fb868a
@@ -600,10 +600,9 @@ static int adxl372_get_status(struct adxl372_state *st,
|
||||
|
||||
static void adxl372_arrange_axis_data(struct adxl372_state *st, __be16 *sample)
|
||||
{
|
||||
__be16 axis_sample[3];
|
||||
__be16 axis_sample[3] = { };
|
||||
int i = 0;
|
||||
|
||||
memset(axis_sample, 0, 3 * sizeof(__be16));
|
||||
if (ADXL372_X_AXIS_EN(st->fifo_axis_mask))
|
||||
axis_sample[i++] = sample[0];
|
||||
if (ADXL372_Y_AXIS_EN(st->fifo_axis_mask))
|
||||
|
||||
Reference in New Issue
Block a user