iio: adc: dln2-adc: 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-3-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
08ef45efc2
commit
3a780d29ae
@@ -467,7 +467,7 @@ static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
|
||||
struct {
|
||||
__le16 values[DLN2_ADC_MAX_CHANNELS];
|
||||
aligned_s64 timestamp_space;
|
||||
} data;
|
||||
} data = { };
|
||||
struct dln2_adc_get_all_vals dev_data;
|
||||
struct dln2_adc *dln2 = iio_priv(indio_dev);
|
||||
const struct dln2_adc_demux_table *t;
|
||||
@@ -479,8 +479,6 @@ static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
/* Demux operation */
|
||||
for (i = 0; i < dln2->demux_count; ++i) {
|
||||
t = &dln2->demux[i];
|
||||
|
||||
Reference in New Issue
Block a user