* [PATCH 00/28] iio: zero init stack with { } instead of memset()
@ 2025-06-11 22:38 David Lechner
2025-06-11 22:38 ` [PATCH 01/28] iio: accel: adxl372: use = " David Lechner
` (30 more replies)
0 siblings, 31 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Jonathan mentioned recently that he would like to get away from using
memset() to zero-initialize stack memory in the IIO subsystem. And we
have it on good authority that initializing a struct or array with = { }
is the preferred way to do this in the kernel [1]. So here is a series
to take care of that.
[1]: https://lore.kernel.org/linux-iio/202505090942.48EBF01B@keescook/
---
David Lechner (28):
iio: accel: adxl372: use = { } instead of memset()
iio: accel: msa311: use = { } instead of memset()
iio: adc: dln2-adc: use = { } instead of memset()
iio: adc: mt6360-adc: use = { } instead of memset()
iio: adc: rockchip_saradc: use = { } instead of memset()
iio: adc: rtq6056: use = { } instead of memset()
iio: adc: stm32-adc: use = { } instead of memset()
iio: adc: ti-ads1015: use = { } instead of memset()
iio: adc: ti-ads1119: use = { } instead of memset()
iio: adc: ti-lmp92064: use = { } instead of memset()
iio: adc: ti-tsc2046: use = { } instead of memset()
iio: chemical: scd4x: use = { } instead of memset()
iio: chemical: scd30: use = { } instead of memset()
iio: chemical: sunrise_co2: use = { } instead of memset()
iio: dac: ad3552r: use = { } instead of memset()
iio: imu: inv_icm42600: use = { } instead of memset()
iio: imu: inv_mpu6050: use = { } instead of memset()
iio: light: bh1745: use = { } instead of memset()
iio: light: ltr501: use = { } instead of memset()
iio: light: opt4060: use = { } instead of memset()
iio: light: veml6030: use = { } instead of memset()
iio: magnetometer: af8133j: use = { } instead of memset()
iio: pressure: bmp280: use = { } instead of memset()
iio: pressure: mpl3115: use = { } instead of memset()
iio: pressure: mprls0025pa: use = { } instead of memset()
iio: pressure: zpa2326: use = { } instead of memset()
iio: proximity: irsd200: use = { } instead of memset()
iio: temperature: tmp006: use = { } instead of memset()
drivers/iio/accel/adxl372.c | 3 +--
drivers/iio/accel/msa311.c | 4 +---
drivers/iio/adc/dln2-adc.c | 4 +---
drivers/iio/adc/mt6360-adc.c | 3 +--
drivers/iio/adc/rockchip_saradc.c | 4 +---
drivers/iio/adc/rtq6056.c | 4 +---
drivers/iio/adc/stm32-adc.c | 3 +--
drivers/iio/adc/ti-ads1015.c | 4 +---
drivers/iio/adc/ti-ads1119.c | 4 +---
drivers/iio/adc/ti-lmp92064.c | 4 +---
drivers/iio/adc/ti-tsc2046.c | 3 +--
drivers/iio/chemical/scd30_core.c | 3 +--
drivers/iio/chemical/scd4x.c | 3 +--
drivers/iio/chemical/sunrise_co2.c | 6 ++----
drivers/iio/dac/ad3552r.c | 3 +--
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
drivers/iio/light/bh1745.c | 4 +---
drivers/iio/light/ltr501.c | 4 +---
drivers/iio/light/opt4060.c | 4 +---
drivers/iio/light/veml6030.c | 4 +---
drivers/iio/magnetometer/af8133j.c | 4 +---
drivers/iio/pressure/bmp280-core.c | 5 +----
drivers/iio/pressure/mpl3115.c | 3 +--
drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
drivers/iio/pressure/zpa2326.c | 4 +---
drivers/iio/proximity/irsd200.c | 3 +--
drivers/iio/temperature/tmp006.c | 4 +---
30 files changed, 34 insertions(+), 85 deletions(-)
---
base-commit: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
change-id: 20250611-iio-zero-init-stack-with-instead-of-memset-0d12d41a7ecb
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH 01/28] iio: accel: adxl372: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 02/28] iio: accel: msa311: " David Lechner
` (29 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/accel/adxl372.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c
index 961145b502934674e7655573b12121fffb2328db..46d518a2a029179bdd2cc2b9e98f09b6b9854fba 100644
--- a/drivers/iio/accel/adxl372.c
+++ b/drivers/iio/accel/adxl372.c
@@ -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))
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 02/28] iio: accel: msa311: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
2025-06-11 22:38 ` [PATCH 01/28] iio: accel: adxl372: use = " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 03/28] iio: adc: dln2-adc: " David Lechner
` (28 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/accel/msa311.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c
index c31c53abc3d09f29d01efb7cfd31955cd88b9409..3e10225410e89a341411a75e544a890f45c8f55e 100644
--- a/drivers/iio/accel/msa311.c
+++ b/drivers/iio/accel/msa311.c
@@ -897,9 +897,7 @@ static irqreturn_t msa311_buffer_thread(int irq, void *p)
struct {
__le16 channels[MSA311_SI_Z + 1];
aligned_s64 ts;
- } buf;
-
- memset(&buf, 0, sizeof(buf));
+ } buf = { };
mutex_lock(&msa311->lock);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 03/28] iio: adc: dln2-adc: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
2025-06-11 22:38 ` [PATCH 01/28] iio: accel: adxl372: use = " David Lechner
2025-06-11 22:38 ` [PATCH 02/28] iio: accel: msa311: " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 04/28] iio: adc: mt6360-adc: " David Lechner
` (27 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/dln2-adc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c
index 9dbd2c87938c23d91fc93269763263fe73ed5206..5aea7644780f8b32ca6ed80b79afd07220d46a5c 100644
--- a/drivers/iio/adc/dln2-adc.c
+++ b/drivers/iio/adc/dln2-adc.c
@@ -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];
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 04/28] iio: adc: mt6360-adc: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (2 preceding siblings ...)
2025-06-11 22:38 ` [PATCH 03/28] iio: adc: dln2-adc: " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 05/28] iio: adc: rockchip_saradc: " David Lechner
` (26 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/mt6360-adc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
index f8e98b6fa7e923c6b73bedf9ca1c466e7a9c3c47..69b3569c90e5b665e1d2c59621df00d6142fbe9c 100644
--- a/drivers/iio/adc/mt6360-adc.c
+++ b/drivers/iio/adc/mt6360-adc.c
@@ -264,10 +264,9 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p)
struct {
u16 values[MT6360_CHAN_MAX];
aligned_s64 timestamp;
- } data;
+ } data = { };
int i = 0, bit, val, ret;
- memset(&data, 0, sizeof(data));
iio_for_each_active_channel(indio_dev, bit) {
ret = mt6360_adc_read_channel(mad, bit, &val);
if (ret < 0) {
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 05/28] iio: adc: rockchip_saradc: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (3 preceding siblings ...)
2025-06-11 22:38 ` [PATCH 04/28] iio: adc: mt6360-adc: " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 06/28] iio: adc: rtq6056: " David Lechner
` (25 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/rockchip_saradc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 325e3747a1345c84cddcfe9a455da6ccf655447b..bd62daea0a3e5b879a8a970d107e3342fda7b8c0 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -404,12 +404,10 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
struct {
u16 values[SARADC_MAX_CHANNELS];
aligned_s64 timestamp;
- } data;
+ } data = { };
int ret;
int i, j = 0;
- memset(&data, 0, sizeof(data));
-
mutex_lock(&info->lock);
iio_for_each_active_channel(i_dev, i) {
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 06/28] iio: adc: rtq6056: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (4 preceding siblings ...)
2025-06-11 22:38 ` [PATCH 05/28] iio: adc: rockchip_saradc: " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:38 ` [PATCH 07/28] iio: adc: stm32-adc: " David Lechner
` (24 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/rtq6056.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/rtq6056.c b/drivers/iio/adc/rtq6056.c
index 6ff47415a2221436b1fd548aa0bc070ba5fbb774..ad9738228b7f2db3f3b6cfc01fd97e43b579b687 100644
--- a/drivers/iio/adc/rtq6056.c
+++ b/drivers/iio/adc/rtq6056.c
@@ -645,12 +645,10 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p)
struct {
u16 vals[RTQ6056_MAX_CHANNEL];
aligned_s64 timestamp;
- } data;
+ } data = { };
unsigned int raw;
int i = 0, bit, ret;
- memset(&data, 0, sizeof(data));
-
pm_runtime_get_sync(dev);
iio_for_each_active_channel(indio_dev, bit) {
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 07/28] iio: adc: stm32-adc: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (5 preceding siblings ...)
2025-06-11 22:38 ` [PATCH 06/28] iio: adc: rtq6056: " David Lechner
@ 2025-06-11 22:38 ` David Lechner
2025-06-11 22:39 ` [PATCH 08/28] iio: adc: ti-ads1015: " David Lechner
` (23 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:38 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/stm32-adc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index e84babf433853977b77aa283025f446353510a21..588c69e175f5129030eef9ebfe0eabb6412b1893 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -2470,7 +2470,7 @@ static int stm32_adc_chan_fw_init(struct iio_dev *indio_dev, bool timestamping)
static int stm32_adc_dma_request(struct device *dev, struct iio_dev *indio_dev)
{
struct stm32_adc *adc = iio_priv(indio_dev);
- struct dma_slave_config config;
+ struct dma_slave_config config = { };
int ret;
adc->dma_chan = dma_request_chan(dev, "rx");
@@ -2494,7 +2494,6 @@ static int stm32_adc_dma_request(struct device *dev, struct iio_dev *indio_dev)
}
/* Configure DMA channel to read data register */
- memset(&config, 0, sizeof(config));
config.src_addr = (dma_addr_t)adc->common->phys_base;
config.src_addr += adc->offset + adc->cfg->regs->dr;
config.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 08/28] iio: adc: ti-ads1015: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (6 preceding siblings ...)
2025-06-11 22:38 ` [PATCH 07/28] iio: adc: stm32-adc: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 09/28] iio: adc: ti-ads1119: " David Lechner
` (22 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ti-ads1015.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 21181cc3bd852ba3bb05b295c98b3530d8c07d3d..48549d617e5fdc363a5ff583a2b303cc8adc9eae 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -450,11 +450,9 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p)
struct {
s16 chan;
aligned_s64 timestamp;
- } scan;
+ } scan = { };
int chan, ret, res;
- memset(&scan, 0, sizeof(scan));
-
mutex_lock(&data->lock);
chan = find_first_bit(indio_dev->active_scan_mask,
iio_get_masklength(indio_dev));
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 09/28] iio: adc: ti-ads1119: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (7 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 08/28] iio: adc: ti-ads1015: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-12 8:16 ` Francesco Dolcini
2025-06-11 22:39 ` [PATCH 10/28] iio: adc: ti-lmp92064: " David Lechner
` (21 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ti-ads1119.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
index d280c949cf476c7bcbc1e046755619ac31d97c63..d2f86e1ec65641feb3625218611fc8ca00e9f64f 100644
--- a/drivers/iio/adc/ti-ads1119.c
+++ b/drivers/iio/adc/ti-ads1119.c
@@ -507,12 +507,10 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
struct {
s16 sample;
aligned_s64 timestamp;
- } scan;
+ } scan = { };
unsigned int index;
int ret;
- memset(&scan, 0, sizeof(scan));
-
if (!iio_trigger_using_own(indio_dev)) {
index = find_first_bit(indio_dev->active_scan_mask,
iio_get_masklength(indio_dev));
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 10/28] iio: adc: ti-lmp92064: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (8 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 09/28] iio: adc: ti-ads1119: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-12 5:41 ` Leonard Göhrs
2025-06-11 22:39 ` [PATCH 11/28] iio: adc: ti-tsc2046: " David Lechner
` (20 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ti-lmp92064.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ti-lmp92064.c b/drivers/iio/adc/ti-lmp92064.c
index 3f375c1f586c4153caf9b47c34a0dcf6d5c48266..7e57006a8a1268cdda3a31d7c0366f72e1b11ea7 100644
--- a/drivers/iio/adc/ti-lmp92064.c
+++ b/drivers/iio/adc/ti-lmp92064.c
@@ -200,11 +200,9 @@ static irqreturn_t lmp92064_trigger_handler(int irq, void *p)
struct {
u16 values[2];
aligned_s64 timestamp;
- } data;
+ } data = { };
int ret;
- memset(&data, 0, sizeof(data));
-
ret = lmp92064_read_meas(priv, data.values);
if (ret)
goto err;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 11/28] iio: adc: ti-tsc2046: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (9 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 10/28] iio: adc: ti-lmp92064: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-12 4:30 ` Oleksij Rempel
2025-06-11 22:39 ` [PATCH 12/28] iio: chemical: scd4x: " David Lechner
` (19 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ti-tsc2046.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index c2d2aada6772aae6fc8d01c3878d6e869d413bc7..74471f08662e0291b097fcb277b8ad9cb6df200c 100644
--- a/drivers/iio/adc/ti-tsc2046.c
+++ b/drivers/iio/adc/ti-tsc2046.c
@@ -276,7 +276,7 @@ static int tsc2046_adc_read_one(struct tsc2046_adc_priv *priv, int ch_idx,
struct tsc2046_adc_ch_cfg *ch = &priv->ch_cfg[ch_idx];
unsigned int val, val_normalized = 0;
int ret, i, count_skip = 0, max_count;
- struct spi_transfer xfer;
+ struct spi_transfer xfer = { };
struct spi_message msg;
u8 cmd;
@@ -314,7 +314,6 @@ static int tsc2046_adc_read_one(struct tsc2046_adc_priv *priv, int ch_idx,
/* automatically power down on last sample */
tx_buf[i].cmd = tsc2046_adc_get_cmd(priv, ch_idx, false);
- memset(&xfer, 0, sizeof(xfer));
xfer.tx_buf = tx_buf;
xfer.rx_buf = rx_buf;
xfer.len = sizeof(*tx_buf) * max_count;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 12/28] iio: chemical: scd4x: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (10 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 11/28] iio: adc: ti-tsc2046: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 13/28] iio: chemical: scd30: " David Lechner
` (18 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/chemical/scd4x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/chemical/scd4x.c b/drivers/iio/chemical/scd4x.c
index 2463149519b6d82caede9c9b253942fa421fdd3c..8859f89fb2a942d940b1ba7adf202977df7b4ad6 100644
--- a/drivers/iio/chemical/scd4x.c
+++ b/drivers/iio/chemical/scd4x.c
@@ -665,10 +665,9 @@ static irqreturn_t scd4x_trigger_handler(int irq, void *p)
struct {
uint16_t data[3];
aligned_s64 ts;
- } scan;
+ } scan = { };
int ret;
- memset(&scan, 0, sizeof(scan));
mutex_lock(&state->lock);
ret = scd4x_read_poll(state, scan.data);
mutex_unlock(&state->lock);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 13/28] iio: chemical: scd30: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (11 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 12/28] iio: chemical: scd4x: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 14/28] iio: chemical: sunrise_co2: " David Lechner
` (17 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/chemical/scd30_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c
index 8316720b1fa32b9746b4aeefe7aedc77b3ba57e6..5df1926cd5d985a60c7095f692a63093d522d434 100644
--- a/drivers/iio/chemical/scd30_core.c
+++ b/drivers/iio/chemical/scd30_core.c
@@ -587,7 +587,7 @@ static irqreturn_t scd30_trigger_handler(int irq, void *p)
struct {
int data[SCD30_MEAS_COUNT];
aligned_s64 ts;
- } scan;
+ } scan = { };
int ret;
mutex_lock(&state->lock);
@@ -595,7 +595,6 @@ static irqreturn_t scd30_trigger_handler(int irq, void *p)
ret = scd30_read_poll(state);
else
ret = scd30_read_meas(state);
- memset(&scan, 0, sizeof(scan));
memcpy(scan.data, state->meas, sizeof(state->meas));
mutex_unlock(&state->lock);
if (ret)
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 14/28] iio: chemical: sunrise_co2: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (12 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 13/28] iio: chemical: scd30: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 15/28] iio: dac: ad3552r: " David Lechner
` (16 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/chemical/sunrise_co2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/chemical/sunrise_co2.c b/drivers/iio/chemical/sunrise_co2.c
index af79efde37e89170128ef9351bf1ad8b993d4a2d..158be9d798d26199cfb40ef0d294f967ba8a737f 100644
--- a/drivers/iio/chemical/sunrise_co2.c
+++ b/drivers/iio/chemical/sunrise_co2.c
@@ -51,13 +51,12 @@ static int sunrise_regmap_read(void *context, const void *reg_buf,
{
struct i2c_client *client = context;
struct sunrise_dev *sunrise = i2c_get_clientdata(client);
- union i2c_smbus_data data;
+ union i2c_smbus_data data = { };
int ret;
if (reg_size != 1 || !val_size)
return -EINVAL;
- memset(&data, 0, sizeof(data));
data.block[0] = val_size;
/*
@@ -88,14 +87,13 @@ static int sunrise_regmap_write(void *context, const void *val_buf, size_t count
{
struct i2c_client *client = context;
struct sunrise_dev *sunrise = i2c_get_clientdata(client);
- union i2c_smbus_data data;
+ union i2c_smbus_data data = { };
/* Discard reg address from values count. */
if (!count)
return -EINVAL;
count--;
- memset(&data, 0, sizeof(data));
data.block[0] = count;
memcpy(&data.block[1], (u8 *)val_buf + 1, count);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 15/28] iio: dac: ad3552r: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (13 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 14/28] iio: chemical: sunrise_co2: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 16/28] iio: imu: inv_icm42600: " David Lechner
` (15 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/dac/ad3552r.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index a44b163f318315cec179aa2ac9d66883a327ebb9..93c33bc3e1be438c2e10c1ca990d8046ba87c9d0 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -293,10 +293,9 @@ static irqreturn_t ad3552r_trigger_handler(int irq, void *p)
struct iio_buffer *buf = indio_dev->buffer;
struct ad3552r_desc *dac = iio_priv(indio_dev);
/* Maximum size of a scan */
- u8 buff[AD3552R_MAX_CH * AD3552R_MAX_REG_SIZE];
+ u8 buff[AD3552R_MAX_CH * AD3552R_MAX_REG_SIZE] = { };
int err;
- memset(buff, 0, sizeof(buff));
err = iio_pop_from_buffer(buf, buff);
if (err)
goto end;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 16/28] iio: imu: inv_icm42600: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (14 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 15/28] iio: dac: ad3552r: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-14 12:21 ` Jonathan Cameron
2025-06-11 22:39 ` [PATCH 17/28] iio: imu: inv_mpu6050: " David Lechner
` (14 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
index e6cd9dcb0687d19554e63a69dc60f065c58d70ee..dbd315ad3c4d2bd5085f7cd3cdc6de4391b1c896 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
@@ -902,7 +902,8 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
const int8_t *temp;
unsigned int odr;
int64_t ts_val;
- struct inv_icm42600_accel_buffer buffer;
+ /* buffer is copied to userspace, zeroing it to avoid any data leak */
+ struct inv_icm42600_accel_buffer buffer = { };
/* parse all fifo packets */
for (i = 0, no = 0; i < st->fifo.count; i += size, ++no) {
@@ -921,8 +922,6 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
inv_sensors_timestamp_apply_odr(ts, st->fifo.period,
st->fifo.nb.total, no);
- /* buffer is copied to userspace, zeroing it to avoid any data leak */
- memset(&buffer, 0, sizeof(buffer));
memcpy(&buffer.accel, accel, sizeof(buffer.accel));
/* convert 8 bits FIFO temperature in high resolution format */
buffer.temp = temp ? (*temp * 64) : 0;
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
index b4d7ce1432a4f4d096599877040a89ede0625e0b..4058eca076d8b03a2290535eedffa0a74098d739 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
@@ -806,7 +806,8 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)
const int8_t *temp;
unsigned int odr;
int64_t ts_val;
- struct inv_icm42600_gyro_buffer buffer;
+ /* buffer is copied to userspace, zeroing it to avoid any data leak */
+ struct inv_icm42600_gyro_buffer buffer = { };
/* parse all fifo packets */
for (i = 0, no = 0; i < st->fifo.count; i += size, ++no) {
@@ -825,8 +826,6 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)
inv_sensors_timestamp_apply_odr(ts, st->fifo.period,
st->fifo.nb.total, no);
- /* buffer is copied to userspace, zeroing it to avoid any data leak */
- memset(&buffer, 0, sizeof(buffer));
memcpy(&buffer.gyro, gyro, sizeof(buffer.gyro));
/* convert 8 bits FIFO temperature in high resolution format */
buffer.temp = temp ? (*temp * 64) : 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 17/28] iio: imu: inv_mpu6050: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (15 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 16/28] iio: imu: inv_icm42600: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 18/28] iio: light: bh1745: " David Lechner
` (13 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
index a9bcf02e5b43fac0e210c6f78816a3c042b52f3d..460792ed27e03192464066dfa088734f0b6b1cdf 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
@@ -130,12 +130,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
st->mux_client = NULL;
if (adev) {
- struct i2c_board_info info;
+ struct i2c_board_info info = { };
struct i2c_client *mux_client;
int ret = -1;
- memset(&info, 0, sizeof(info));
-
dmi_check_system(inv_mpu_dev_list);
switch (matched_product_name) {
case INV_MPU_ASUS_T100TA:
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index 273196e647a2b5a4860e18cfa34a088c773540e4..c4c11124f92f7fa6730e7443e3be67d920b8c115 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -50,7 +50,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
u16 fifo_count;
u32 fifo_period;
s64 timestamp;
- u8 data[INV_MPU6050_OUTPUT_DATA_SIZE] __aligned(8);
+ /* clear internal data buffer for avoiding kernel data leak */
+ u8 data[INV_MPU6050_OUTPUT_DATA_SIZE] __aligned(8) = { };
size_t i, nb;
mutex_lock(&st->lock);
@@ -103,9 +104,6 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
inv_sensors_timestamp_interrupt(&st->timestamp, 1, pf->timestamp);
inv_sensors_timestamp_apply_odr(&st->timestamp, fifo_period, 1, 0);
- /* clear internal data buffer for avoiding kernel data leak */
- memset(data, 0, sizeof(data));
-
/* read all data once and process every samples */
result = regmap_noinc_read(st->map, st->reg->fifo_r_w, st->data, fifo_count);
if (result)
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 18/28] iio: light: bh1745: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (16 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 17/28] iio: imu: inv_mpu6050: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 19/28] iio: light: ltr501: " David Lechner
` (12 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/light/bh1745.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c
index 56ab5fe90ff9128035cf25948bba1589492e66e4..4e9bd8f831f7834dbcdbc5df4931f473d277d814 100644
--- a/drivers/iio/light/bh1745.c
+++ b/drivers/iio/light/bh1745.c
@@ -740,14 +740,12 @@ static irqreturn_t bh1745_trigger_handler(int interrupt, void *p)
struct {
u16 chans[4];
aligned_s64 timestamp;
- } scan;
+ } scan = { };
u16 value;
int ret;
int i;
int j = 0;
- memset(&scan, 0, sizeof(scan));
-
iio_for_each_active_channel(indio_dev, i) {
ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i,
&value, 2);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 19/28] iio: light: ltr501: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (17 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 18/28] iio: light: bh1745: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 20/28] iio: light: opt4060: " David Lechner
` (11 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/light/ltr501.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index db0cc3642bd8010358de8515c24337d7385bce38..c14767472fbe8620ad59c8417d2ceff14f9485a6 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1279,14 +1279,12 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
struct {
u16 channels[3];
aligned_s64 ts;
- } scan;
+ } scan = { };
__le16 als_buf[2];
u8 mask = 0;
int j = 0;
int ret, psdata;
- memset(&scan, 0, sizeof(scan));
-
/* figure out which data needs to be ready */
if (test_bit(0, indio_dev->active_scan_mask) ||
test_bit(1, indio_dev->active_scan_mask))
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 20/28] iio: light: opt4060: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (18 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 19/28] iio: light: ltr501: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 21/28] iio: light: veml6030: " David Lechner
` (10 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/light/opt4060.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/opt4060.c b/drivers/iio/light/opt4060.c
index f4085020e03ebadb2b91db3212449db82d738ebd..3c927149bd256b392ed8d1bfa9847788981ef2f0 100644
--- a/drivers/iio/light/opt4060.c
+++ b/drivers/iio/light/opt4060.c
@@ -1083,7 +1083,7 @@ static irqreturn_t opt4060_trigger_handler(int irq, void *p)
struct {
u32 chan[OPT4060_NUM_CHANS];
aligned_s64 ts;
- } raw;
+ } raw = { };
int i = 0;
int chan, ret;
@@ -1091,8 +1091,6 @@ static irqreturn_t opt4060_trigger_handler(int irq, void *p)
if (iio_trigger_validate_own_device(idev->trig, idev))
opt4060_trigger_new_samples(idev);
- memset(&raw, 0, sizeof(raw));
-
iio_for_each_active_channel(idev, chan) {
if (chan == OPT4060_ILLUM)
ret = opt4060_calc_illuminance(chip, &raw.chan[i++]);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 21/28] iio: light: veml6030: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (19 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 20/28] iio: light: opt4060: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-12 3:28 ` Javier Carrasco
2025-06-11 22:39 ` [PATCH 22/28] iio: magnetometer: af8133j: " David Lechner
` (9 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/light/veml6030.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
index 473a9c3e32a3a53f373595a5113b47e795f5366c..0945f146bedbda79511e704158122acaac5e60c1 100644
--- a/drivers/iio/light/veml6030.c
+++ b/drivers/iio/light/veml6030.c
@@ -892,9 +892,7 @@ static irqreturn_t veml6030_trigger_handler(int irq, void *p)
struct {
u16 chans[2];
aligned_s64 timestamp;
- } scan;
-
- memset(&scan, 0, sizeof(scan));
+ } scan = { };
iio_for_each_active_channel(iio, ch) {
ret = regmap_read(data->regmap, VEML6030_REG_DATA(ch),
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 22/28] iio: magnetometer: af8133j: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (20 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 21/28] iio: light: veml6030: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 23/28] iio: pressure: bmp280: " David Lechner
` (8 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/magnetometer/af8133j.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/magnetometer/af8133j.c b/drivers/iio/magnetometer/af8133j.c
index 192ba2da94e299d9a223a33bf15f9d6e6c29f6c7..b1768c3aa8f33c6e95e770a27f55cb357e6ac6f4 100644
--- a/drivers/iio/magnetometer/af8133j.c
+++ b/drivers/iio/magnetometer/af8133j.c
@@ -361,11 +361,9 @@ static irqreturn_t af8133j_trigger_handler(int irq, void *p)
struct {
__le16 values[3];
aligned_s64 timestamp;
- } sample;
+ } sample = { };
int ret;
- memset(&sample, 0, sizeof(sample));
-
ret = af8133j_read_measurement(data, sample.values);
if (ret)
goto out_done;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 23/28] iio: pressure: bmp280: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (21 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 22/28] iio: magnetometer: af8133j: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 24/28] iio: pressure: mpl3115: " David Lechner
` (7 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/pressure/bmp280-core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index f37f20776c89173b0b2a8e28be0ef9aa30ceea53..74505c9ec1a08cf3ffdb55bf578d40ede3cc5d00 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -1234,12 +1234,9 @@ static irqreturn_t bme280_trigger_handler(int irq, void *p)
s32 comp_temp;
u32 comp_humidity;
aligned_s64 timestamp;
- } buffer;
+ } buffer = { }; /* Don't leak uninitialized stack to userspace. */
int ret;
- /* Don't leak uninitialized stack to userspace. */
- memset(&buffer, 0, sizeof(buffer));
-
guard(mutex)(&data->lock);
/* Burst read data registers */
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 24/28] iio: pressure: mpl3115: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (22 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 23/28] iio: pressure: bmp280: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 25/28] iio: pressure: mprls0025pa: " David Lechner
` (6 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/pressure/mpl3115.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/pressure/mpl3115.c b/drivers/iio/pressure/mpl3115.c
index d6715997f13727e22346a76819cb7dc58a96614e..579da60ef441482a82f3bdf4f67436a13ab3e09d 100644
--- a/drivers/iio/pressure/mpl3115.c
+++ b/drivers/iio/pressure/mpl3115.c
@@ -160,7 +160,7 @@ static irqreturn_t mpl3115_trigger_handler(int irq, void *p)
* of the buffer may be either 16 or 32-bits. As such we cannot
* use a simple structure definition to express this data layout.
*/
- u8 buffer[16] __aligned(8);
+ u8 buffer[16] __aligned(8) = { };
int ret, pos = 0;
mutex_lock(&data->lock);
@@ -170,7 +170,6 @@ static irqreturn_t mpl3115_trigger_handler(int irq, void *p)
goto done;
}
- memset(buffer, 0, sizeof(buffer));
if (test_bit(0, indio_dev->active_scan_mask)) {
ret = i2c_smbus_read_i2c_block_data(data->client,
MPL3115_OUT_PRESS, 3, &buffer[pos]);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 25/28] iio: pressure: mprls0025pa: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (23 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 24/28] iio: pressure: mpl3115: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-14 12:23 ` Jonathan Cameron
2025-06-11 22:39 ` [PATCH 26/28] iio: pressure: zpa2326: " David Lechner
` (5 subsequent siblings)
30 siblings, 1 reply; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
The initialize of the cmd value is trivial so it can be moved to the
array initializer as well.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/iio/pressure/mprls0025pa_i2c.c b/drivers/iio/pressure/mprls0025pa_i2c.c
index 1a48f8d43d716b28b8fceb8e1a06d63a73a74a86..79811fd4a02b370b3fde8bd67a5115a3934f8614 100644
--- a/drivers/iio/pressure/mprls0025pa_i2c.c
+++ b/drivers/iio/pressure/mprls0025pa_i2c.c
@@ -44,10 +44,7 @@ static int mpr_i2c_write(struct mpr_data *data, const u8 cmd, const u8 unused)
{
int ret;
struct i2c_client *client = to_i2c_client(data->dev);
- u8 wdata[MPR_PKT_SYNC_LEN];
-
- memset(wdata, 0, sizeof(wdata));
- wdata[0] = cmd;
+ u8 wdata[MPR_PKT_SYNC_LEN] = { cmd };
ret = i2c_master_send(client, wdata, MPR_PKT_SYNC_LEN);
if (ret < 0)
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 26/28] iio: pressure: zpa2326: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (24 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 25/28] iio: pressure: mprls0025pa: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 27/28] iio: proximity: irsd200: " David Lechner
` (4 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/pressure/zpa2326.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
index 1640aa3717eddc135dfac9d5e45d899ae2579f64..6eef37c0952d7c209478911413de2cf3d2552920 100644
--- a/drivers/iio/pressure/zpa2326.c
+++ b/drivers/iio/pressure/zpa2326.c
@@ -583,11 +583,9 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
u32 pressure;
u16 temperature;
aligned_s64 timestamp;
- } sample;
+ } sample = { };
int err;
- memset(&sample, 0, sizeof(sample));
-
if (test_bit(0, indio_dev->active_scan_mask)) {
/* Get current pressure from hardware FIFO. */
err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 27/28] iio: proximity: irsd200: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (25 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 26/28] iio: pressure: zpa2326: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-11 22:39 ` [PATCH 28/28] iio: temperature: tmp006: " David Lechner
` (3 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/proximity/irsd200.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd200.c
index 5e751fb0b12fb2167f4d11e814915cb2761ab9bf..253e4aef22fbdca84a0f8393d6f423385c8dcda8 100644
--- a/drivers/iio/proximity/irsd200.c
+++ b/drivers/iio/proximity/irsd200.c
@@ -763,10 +763,9 @@ static irqreturn_t irsd200_trigger_handler(int irq, void *pollf)
struct {
s16 channel;
aligned_s64 ts;
- } scan;
+ } scan = { };
int ret;
- memset(&scan, 0, sizeof(scan));
ret = irsd200_read_data(data, &scan.channel);
if (ret)
goto end;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH 28/28] iio: temperature: tmp006: use = { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (26 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 27/28] iio: proximity: irsd200: " David Lechner
@ 2025-06-11 22:39 ` David Lechner
2025-06-12 6:09 ` [PATCH 00/28] iio: zero init stack with " Nuno Sá
` (2 subsequent siblings)
30 siblings, 0 replies; 46+ messages in thread
From: David Lechner @ 2025-06-11 22:39 UTC (permalink / raw)
To: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32, David Lechner
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/temperature/tmp006.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
index 29bff9d8859d017e1b59536c531f732a2d749631..10bd3f221929d1b58b7e6a6bd9a75d5d068edf84 100644
--- a/drivers/iio/temperature/tmp006.c
+++ b/drivers/iio/temperature/tmp006.c
@@ -254,11 +254,9 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p)
struct {
s16 channels[2];
aligned_s64 ts;
- } scan;
+ } scan = { };
s32 ret;
- memset(&scan, 0, sizeof(scan));
-
ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT);
if (ret < 0)
goto err;
--
2.43.0
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH 21/28] iio: light: veml6030: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 21/28] iio: light: veml6030: " David Lechner
@ 2025-06-12 3:28 ` Javier Carrasco
0 siblings, 0 replies; 46+ messages in thread
From: Javier Carrasco @ 2025-06-12 3:28 UTC (permalink / raw)
To: David Lechner, Michael Hennerich, Lars-Peter Clausen,
Jonathan Cameron, Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Ondřej Jirman,
Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32
On Thu Jun 12, 2025 at 3:39 AM +05, David Lechner wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> drivers/iio/light/veml6030.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
> index 473a9c3e32a3a53f373595a5113b47e795f5366c..0945f146bedbda79511e704158122acaac5e60c1 100644
> --- a/drivers/iio/light/veml6030.c
> +++ b/drivers/iio/light/veml6030.c
> @@ -892,9 +892,7 @@ static irqreturn_t veml6030_trigger_handler(int irq, void *p)
> struct {
> u16 chans[2];
> aligned_s64 timestamp;
> - } scan;
> -
> - memset(&scan, 0, sizeof(scan));
> + } scan = { };
>
> iio_for_each_active_channel(iio, ch) {
> ret = regmap_read(data->regmap, VEML6030_REG_DATA(ch),
Thank you for the patch, it looks cleaner and simpler :) I trust the
sources you provided, but I tested it with real hardware just in case.
Tested-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 11/28] iio: adc: ti-tsc2046: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 11/28] iio: adc: ti-tsc2046: " David Lechner
@ 2025-06-12 4:30 ` Oleksij Rempel
0 siblings, 0 replies; 46+ messages in thread
From: Oleksij Rempel @ 2025-06-12 4:30 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-rockchip, linux-mediatek, linux-stm32,
linux-arm-kernel
On Wed, Jun 11, 2025 at 05:39:03PM -0500, David Lechner wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 10/28] iio: adc: ti-lmp92064: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 10/28] iio: adc: ti-lmp92064: " David Lechner
@ 2025-06-12 5:41 ` Leonard Göhrs
0 siblings, 0 replies; 46+ messages in thread
From: Leonard Göhrs @ 2025-06-12 5:41 UTC (permalink / raw)
To: David Lechner, Michael Hennerich, Lars-Peter Clausen,
Jonathan Cameron, Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, kernel, Oleksij Rempel,
Roan van Dijk, Jacopo Mondi, Jean-Baptiste Maneyrol, Mudit Sharma,
Javier Carrasco, Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32
Am 12.06.25 um 00:39 schrieb David Lechner:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Leonard Göhrs <l.goehrs@pengutronix.de>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (27 preceding siblings ...)
2025-06-11 22:39 ` [PATCH 28/28] iio: temperature: tmp006: " David Lechner
@ 2025-06-12 6:09 ` Nuno Sá
2025-06-12 9:17 ` Pavel Machek
2025-06-12 12:51 ` Andy Shevchenko
30 siblings, 0 replies; 46+ messages in thread
From: Nuno Sá @ 2025-06-12 6:09 UTC (permalink / raw)
To: David Lechner, Michael Hennerich, Lars-Peter Clausen,
Jonathan Cameron, Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan
Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-rockchip, linux-stm32
On Wed, 2025-06-11 at 17:38 -0500, David Lechner wrote:
> Jonathan mentioned recently that he would like to get away from using
> memset() to zero-initialize stack memory in the IIO subsystem. And we
> have it on good authority that initializing a struct or array with = { }
> is the preferred way to do this in the kernel [1]. So here is a series
> to take care of that.
>
> [1]: https://lore.kernel.org/linux-iio/202505090942.48EBF01B@keescook/
>
> ---
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> David Lechner (28):
> iio: accel: adxl372: use = { } instead of memset()
> iio: accel: msa311: use = { } instead of memset()
> iio: adc: dln2-adc: use = { } instead of memset()
> iio: adc: mt6360-adc: use = { } instead of memset()
> iio: adc: rockchip_saradc: use = { } instead of memset()
> iio: adc: rtq6056: use = { } instead of memset()
> iio: adc: stm32-adc: use = { } instead of memset()
> iio: adc: ti-ads1015: use = { } instead of memset()
> iio: adc: ti-ads1119: use = { } instead of memset()
> iio: adc: ti-lmp92064: use = { } instead of memset()
> iio: adc: ti-tsc2046: use = { } instead of memset()
> iio: chemical: scd4x: use = { } instead of memset()
> iio: chemical: scd30: use = { } instead of memset()
> iio: chemical: sunrise_co2: use = { } instead of memset()
> iio: dac: ad3552r: use = { } instead of memset()
> iio: imu: inv_icm42600: use = { } instead of memset()
> iio: imu: inv_mpu6050: use = { } instead of memset()
> iio: light: bh1745: use = { } instead of memset()
> iio: light: ltr501: use = { } instead of memset()
> iio: light: opt4060: use = { } instead of memset()
> iio: light: veml6030: use = { } instead of memset()
> iio: magnetometer: af8133j: use = { } instead of memset()
> iio: pressure: bmp280: use = { } instead of memset()
> iio: pressure: mpl3115: use = { } instead of memset()
> iio: pressure: mprls0025pa: use = { } instead of memset()
> iio: pressure: zpa2326: use = { } instead of memset()
> iio: proximity: irsd200: use = { } instead of memset()
> iio: temperature: tmp006: use = { } instead of memset()
>
> drivers/iio/accel/adxl372.c | 3 +--
> drivers/iio/accel/msa311.c | 4 +---
> drivers/iio/adc/dln2-adc.c | 4 +---
> drivers/iio/adc/mt6360-adc.c | 3 +--
> drivers/iio/adc/rockchip_saradc.c | 4 +---
> drivers/iio/adc/rtq6056.c | 4 +---
> drivers/iio/adc/stm32-adc.c | 3 +--
> drivers/iio/adc/ti-ads1015.c | 4 +---
> drivers/iio/adc/ti-ads1119.c | 4 +---
> drivers/iio/adc/ti-lmp92064.c | 4 +---
> drivers/iio/adc/ti-tsc2046.c | 3 +--
> drivers/iio/chemical/scd30_core.c | 3 +--
> drivers/iio/chemical/scd4x.c | 3 +--
> drivers/iio/chemical/sunrise_co2.c | 6 ++----
> drivers/iio/dac/ad3552r.c | 3 +--
> drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
> drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
> drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
> drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> drivers/iio/light/bh1745.c | 4 +---
> drivers/iio/light/ltr501.c | 4 +---
> drivers/iio/light/opt4060.c | 4 +---
> drivers/iio/light/veml6030.c | 4 +---
> drivers/iio/magnetometer/af8133j.c | 4 +---
> drivers/iio/pressure/bmp280-core.c | 5 +----
> drivers/iio/pressure/mpl3115.c | 3 +--
> drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
> drivers/iio/pressure/zpa2326.c | 4 +---
> drivers/iio/proximity/irsd200.c | 3 +--
> drivers/iio/temperature/tmp006.c | 4 +---
> 30 files changed, 34 insertions(+), 85 deletions(-)
> ---
> base-commit: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> change-id: 20250611-iio-zero-init-stack-with-instead-of-memset-0d12d41a7ecb
>
> Best regards,
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 09/28] iio: adc: ti-ads1119: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 09/28] iio: adc: ti-ads1119: " David Lechner
@ 2025-06-12 8:16 ` Francesco Dolcini
0 siblings, 0 replies; 46+ messages in thread
From: Francesco Dolcini @ 2025-06-12 8:16 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-rockchip,
linux-stm32
On Wed, Jun 11, 2025 at 05:39:01PM -0500, David Lechner wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (28 preceding siblings ...)
2025-06-12 6:09 ` [PATCH 00/28] iio: zero init stack with " Nuno Sá
@ 2025-06-12 9:17 ` Pavel Machek
2025-06-12 10:45 ` Jonathan Cameron
2025-06-12 12:11 ` Nicolas Frattaroli
2025-06-12 12:51 ` Andy Shevchenko
30 siblings, 2 replies; 46+ messages in thread
From: Pavel Machek @ 2025-06-12 9:17 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-rockchip,
linux-stm32
[-- Attachment #1: Type: text/plain, Size: 4652 bytes --]
Hi!
> Jonathan mentioned recently that he would like to get away from using
> memset() to zero-initialize stack memory in the IIO subsystem. And we
> have it on good authority that initializing a struct or array with = { }
> is the preferred way to do this in the kernel [1]. So here is a series
> to take care of that.
1) Is it worth the churn?
2) Will this fail to initialize padding with some obscure compiler?
3) Why do you believe that {} is the preffered way? All we have is
Kees' email that explains that = {} maybe works in configs he tested.
BR,
Pavel
> [1]:
> https://lore.kernel.org/linux-iio/202505090942.48EBF01B@keescook/
> ---
> David Lechner (28):
> iio: accel: adxl372: use = { } instead of memset()
> iio: accel: msa311: use = { } instead of memset()
> iio: adc: dln2-adc: use = { } instead of memset()
> iio: adc: mt6360-adc: use = { } instead of memset()
> iio: adc: rockchip_saradc: use = { } instead of memset()
> iio: adc: rtq6056: use = { } instead of memset()
> iio: adc: stm32-adc: use = { } instead of memset()
> iio: adc: ti-ads1015: use = { } instead of memset()
> iio: adc: ti-ads1119: use = { } instead of memset()
> iio: adc: ti-lmp92064: use = { } instead of memset()
> iio: adc: ti-tsc2046: use = { } instead of memset()
> iio: chemical: scd4x: use = { } instead of memset()
> iio: chemical: scd30: use = { } instead of memset()
> iio: chemical: sunrise_co2: use = { } instead of memset()
> iio: dac: ad3552r: use = { } instead of memset()
> iio: imu: inv_icm42600: use = { } instead of memset()
> iio: imu: inv_mpu6050: use = { } instead of memset()
> iio: light: bh1745: use = { } instead of memset()
> iio: light: ltr501: use = { } instead of memset()
> iio: light: opt4060: use = { } instead of memset()
> iio: light: veml6030: use = { } instead of memset()
> iio: magnetometer: af8133j: use = { } instead of memset()
> iio: pressure: bmp280: use = { } instead of memset()
> iio: pressure: mpl3115: use = { } instead of memset()
> iio: pressure: mprls0025pa: use = { } instead of memset()
> iio: pressure: zpa2326: use = { } instead of memset()
> iio: proximity: irsd200: use = { } instead of memset()
> iio: temperature: tmp006: use = { } instead of memset()
>
> drivers/iio/accel/adxl372.c | 3 +--
> drivers/iio/accel/msa311.c | 4 +---
> drivers/iio/adc/dln2-adc.c | 4 +---
> drivers/iio/adc/mt6360-adc.c | 3 +--
> drivers/iio/adc/rockchip_saradc.c | 4 +---
> drivers/iio/adc/rtq6056.c | 4 +---
> drivers/iio/adc/stm32-adc.c | 3 +--
> drivers/iio/adc/ti-ads1015.c | 4 +---
> drivers/iio/adc/ti-ads1119.c | 4 +---
> drivers/iio/adc/ti-lmp92064.c | 4 +---
> drivers/iio/adc/ti-tsc2046.c | 3 +--
> drivers/iio/chemical/scd30_core.c | 3 +--
> drivers/iio/chemical/scd4x.c | 3 +--
> drivers/iio/chemical/sunrise_co2.c | 6 ++----
> drivers/iio/dac/ad3552r.c | 3 +--
> drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
> drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
> drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
> drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> drivers/iio/light/bh1745.c | 4 +---
> drivers/iio/light/ltr501.c | 4 +---
> drivers/iio/light/opt4060.c | 4 +---
> drivers/iio/light/veml6030.c | 4 +---
> drivers/iio/magnetometer/af8133j.c | 4 +---
> drivers/iio/pressure/bmp280-core.c | 5 +----
> drivers/iio/pressure/mpl3115.c | 3 +--
> drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
> drivers/iio/pressure/zpa2326.c | 4 +---
> drivers/iio/proximity/irsd200.c | 3 +--
> drivers/iio/temperature/tmp006.c | 4 +---
> 30 files changed, 34 insertions(+), 85 deletions(-)
> ---
> base-commit: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> change-id: 20250611-iio-zero-init-stack-with-instead-of-memset-0d12d41a7ecb
>
> Best regards,
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 9:17 ` Pavel Machek
@ 2025-06-12 10:45 ` Jonathan Cameron
2025-06-12 12:11 ` Nicolas Frattaroli
1 sibling, 0 replies; 46+ messages in thread
From: Jonathan Cameron @ 2025-06-12 10:45 UTC (permalink / raw)
To: Pavel Machek
Cc: David Lechner, Michael Hennerich, Lars-Peter Clausen,
Jonathan Cameron, Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-rockchip,
linux-stm32
On Thu, 12 Jun 2025 11:17:52 +0200
Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > Jonathan mentioned recently that he would like to get away from using
> > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > have it on good authority that initializing a struct or array with = { }
> > is the preferred way to do this in the kernel [1]. So here is a series
> > to take care of that.
>
> 1) Is it worth the churn?
>
> 2) Will this fail to initialize padding with some obscure compiler?
>
> 3) Why do you believe that {} is the preffered way? All we have is
> Kees' email that explains that = {} maybe works in configs he tested.
>
Pavel,
I think main thing that matters in Kees email is there is a self test
that should fire if a compiler ever does this wrong.
Using this syntax is definitely not a 'kernel wide' preference yet
but I do prefer to make some changes like this in IIO just because it
reduces the amount of code that smells different when reviewing.
Given how many drivers we now have, sadly people pick different ones
to cut and paste from so we get a lot of new drivers that look like
how we preferred to do things 10 years ago :(
However it is a fair bit of churn. hmm. Let's let this sit for
a little while and see if other view points come in.
Thanks
Jonathan
> BR,
> Pavel
>
> > [1]:
> > https://lore.kernel.org/linux-iio/202505090942.48EBF01B@keescook/
>
>
>
> > ---
> > David Lechner (28):
> > iio: accel: adxl372: use = { } instead of memset()
> > iio: accel: msa311: use = { } instead of memset()
> > iio: adc: dln2-adc: use = { } instead of memset()
> > iio: adc: mt6360-adc: use = { } instead of memset()
> > iio: adc: rockchip_saradc: use = { } instead of memset()
> > iio: adc: rtq6056: use = { } instead of memset()
> > iio: adc: stm32-adc: use = { } instead of memset()
> > iio: adc: ti-ads1015: use = { } instead of memset()
> > iio: adc: ti-ads1119: use = { } instead of memset()
> > iio: adc: ti-lmp92064: use = { } instead of memset()
> > iio: adc: ti-tsc2046: use = { } instead of memset()
> > iio: chemical: scd4x: use = { } instead of memset()
> > iio: chemical: scd30: use = { } instead of memset()
> > iio: chemical: sunrise_co2: use = { } instead of memset()
> > iio: dac: ad3552r: use = { } instead of memset()
> > iio: imu: inv_icm42600: use = { } instead of memset()
> > iio: imu: inv_mpu6050: use = { } instead of memset()
> > iio: light: bh1745: use = { } instead of memset()
> > iio: light: ltr501: use = { } instead of memset()
> > iio: light: opt4060: use = { } instead of memset()
> > iio: light: veml6030: use = { } instead of memset()
> > iio: magnetometer: af8133j: use = { } instead of memset()
> > iio: pressure: bmp280: use = { } instead of memset()
> > iio: pressure: mpl3115: use = { } instead of memset()
> > iio: pressure: mprls0025pa: use = { } instead of memset()
> > iio: pressure: zpa2326: use = { } instead of memset()
> > iio: proximity: irsd200: use = { } instead of memset()
> > iio: temperature: tmp006: use = { } instead of memset()
> >
> > drivers/iio/accel/adxl372.c | 3 +--
> > drivers/iio/accel/msa311.c | 4 +---
> > drivers/iio/adc/dln2-adc.c | 4 +---
> > drivers/iio/adc/mt6360-adc.c | 3 +--
> > drivers/iio/adc/rockchip_saradc.c | 4 +---
> > drivers/iio/adc/rtq6056.c | 4 +---
> > drivers/iio/adc/stm32-adc.c | 3 +--
> > drivers/iio/adc/ti-ads1015.c | 4 +---
> > drivers/iio/adc/ti-ads1119.c | 4 +---
> > drivers/iio/adc/ti-lmp92064.c | 4 +---
> > drivers/iio/adc/ti-tsc2046.c | 3 +--
> > drivers/iio/chemical/scd30_core.c | 3 +--
> > drivers/iio/chemical/scd4x.c | 3 +--
> > drivers/iio/chemical/sunrise_co2.c | 6 ++----
> > drivers/iio/dac/ad3552r.c | 3 +--
> > drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
> > drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
> > drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
> > drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> > drivers/iio/light/bh1745.c | 4 +---
> > drivers/iio/light/ltr501.c | 4 +---
> > drivers/iio/light/opt4060.c | 4 +---
> > drivers/iio/light/veml6030.c | 4 +---
> > drivers/iio/magnetometer/af8133j.c | 4 +---
> > drivers/iio/pressure/bmp280-core.c | 5 +----
> > drivers/iio/pressure/mpl3115.c | 3 +--
> > drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
> > drivers/iio/pressure/zpa2326.c | 4 +---
> > drivers/iio/proximity/irsd200.c | 3 +--
> > drivers/iio/temperature/tmp006.c | 4 +---
> > 30 files changed, 34 insertions(+), 85 deletions(-)
> > ---
> > base-commit: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> > change-id: 20250611-iio-zero-init-stack-with-instead-of-memset-0d12d41a7ecb
> >
> > Best regards,
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 9:17 ` Pavel Machek
2025-06-12 10:45 ` Jonathan Cameron
@ 2025-06-12 12:11 ` Nicolas Frattaroli
2025-06-12 12:28 ` Andy Shevchenko
2025-06-12 18:54 ` Pavel Machek
1 sibling, 2 replies; 46+ messages in thread
From: Nicolas Frattaroli @ 2025-06-12 12:11 UTC (permalink / raw)
To: David Lechner, linux-rockchip
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-rockchip,
linux-stm32, Pavel Machek
Hello,
I thought I'd chime in as someone uninvolved because this seemed
interesting.
On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> Hi!
>
> > Jonathan mentioned recently that he would like to get away from using
> > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > have it on good authority that initializing a struct or array with = { }
> > is the preferred way to do this in the kernel [1]. So here is a series
> > to take care of that.
>
> 1) Is it worth the churn?
>
> 2) Will this fail to initialize padding with some obscure compiler?
as of right now, the only two C compilers that are supported are
GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the kernel
to finish a build with something else, I think the compiler not
implementing the C standard correctly is the least of their worries.
My bigger worry is that = { } is only guaranteed to be as correct as
memset on C23, and the kernel's standard right now is C11. For that
reason alone, I don't think memset should be moved away from for now,
unless someone can verify that every GCC release >= 8.1 and every
Clang release >= 13.0.1 does the right thing here regardless.
>
> 3) Why do you believe that {} is the preffered way? All we have is
> Kees' email that explains that = {} maybe works in configs he tested.
= { } is guaranteed to work in C23, as per the standard, but again we're
not on C23.
The reason to prefer this is likely that it's easier for static analysis
to see the struct as initialised, but that's me making assumptions here.
A more human-centric argument is that once we're on a C standards version
where = { } is guaranteed to be correct, then = { } is much more obviously
correct to a reader than a memset with a value and a size somewhere later
in the code. This argument is evident from the number of patches in this
series where the memset and the declaration are not in the same hunk.
That's the kind of stuff that keeps me awake at night, sweating profusely.
Kind regards,
Nicolas Frattaroli
>
> BR,
> Pavel
>
> > [1]:
> > https://lore.kernel.org/linux-iio/202505090942.48EBF01B@keescook/
>
>
>
> > ---
> > David Lechner (28):
> > iio: accel: adxl372: use = { } instead of memset()
> > iio: accel: msa311: use = { } instead of memset()
> > iio: adc: dln2-adc: use = { } instead of memset()
> > iio: adc: mt6360-adc: use = { } instead of memset()
> > iio: adc: rockchip_saradc: use = { } instead of memset()
> > iio: adc: rtq6056: use = { } instead of memset()
> > iio: adc: stm32-adc: use = { } instead of memset()
> > iio: adc: ti-ads1015: use = { } instead of memset()
> > iio: adc: ti-ads1119: use = { } instead of memset()
> > iio: adc: ti-lmp92064: use = { } instead of memset()
> > iio: adc: ti-tsc2046: use = { } instead of memset()
> > iio: chemical: scd4x: use = { } instead of memset()
> > iio: chemical: scd30: use = { } instead of memset()
> > iio: chemical: sunrise_co2: use = { } instead of memset()
> > iio: dac: ad3552r: use = { } instead of memset()
> > iio: imu: inv_icm42600: use = { } instead of memset()
> > iio: imu: inv_mpu6050: use = { } instead of memset()
> > iio: light: bh1745: use = { } instead of memset()
> > iio: light: ltr501: use = { } instead of memset()
> > iio: light: opt4060: use = { } instead of memset()
> > iio: light: veml6030: use = { } instead of memset()
> > iio: magnetometer: af8133j: use = { } instead of memset()
> > iio: pressure: bmp280: use = { } instead of memset()
> > iio: pressure: mpl3115: use = { } instead of memset()
> > iio: pressure: mprls0025pa: use = { } instead of memset()
> > iio: pressure: zpa2326: use = { } instead of memset()
> > iio: proximity: irsd200: use = { } instead of memset()
> > iio: temperature: tmp006: use = { } instead of memset()
> >
> > drivers/iio/accel/adxl372.c | 3 +--
> > drivers/iio/accel/msa311.c | 4 +---
> > drivers/iio/adc/dln2-adc.c | 4 +---
> > drivers/iio/adc/mt6360-adc.c | 3 +--
> > drivers/iio/adc/rockchip_saradc.c | 4 +---
> > drivers/iio/adc/rtq6056.c | 4 +---
> > drivers/iio/adc/stm32-adc.c | 3 +--
> > drivers/iio/adc/ti-ads1015.c | 4 +---
> > drivers/iio/adc/ti-ads1119.c | 4 +---
> > drivers/iio/adc/ti-lmp92064.c | 4 +---
> > drivers/iio/adc/ti-tsc2046.c | 3 +--
> > drivers/iio/chemical/scd30_core.c | 3 +--
> > drivers/iio/chemical/scd4x.c | 3 +--
> > drivers/iio/chemical/sunrise_co2.c | 6 ++----
> > drivers/iio/dac/ad3552r.c | 3 +--
> > drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
> > drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
> > drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 4 +---
> > drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> > drivers/iio/light/bh1745.c | 4 +---
> > drivers/iio/light/ltr501.c | 4 +---
> > drivers/iio/light/opt4060.c | 4 +---
> > drivers/iio/light/veml6030.c | 4 +---
> > drivers/iio/magnetometer/af8133j.c | 4 +---
> > drivers/iio/pressure/bmp280-core.c | 5 +----
> > drivers/iio/pressure/mpl3115.c | 3 +--
> > drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
> > drivers/iio/pressure/zpa2326.c | 4 +---
> > drivers/iio/proximity/irsd200.c | 3 +--
> > drivers/iio/temperature/tmp006.c | 4 +---
> > 30 files changed, 34 insertions(+), 85 deletions(-)
> > ---
> > base-commit: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> > change-id: 20250611-iio-zero-init-stack-with-instead-of-memset-0d12d41a7ecb
> >
> > Best regards,
>
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 12:11 ` Nicolas Frattaroli
@ 2025-06-12 12:28 ` Andy Shevchenko
2025-06-12 18:54 ` Pavel Machek
1 sibling, 0 replies; 46+ messages in thread
From: Andy Shevchenko @ 2025-06-12 12:28 UTC (permalink / raw)
To: Nicolas Frattaroli
Cc: David Lechner, linux-rockchip, Michael Hennerich,
Lars-Peter Clausen, Jonathan Cameron, Nuno Sá,
Andy Shevchenko, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Maxime Coquelin, Alexandre Torgue,
Francesco Dolcini, João Paulo Gonçalves,
Leonard Göhrs, kernel, Oleksij Rempel, Roan van Dijk,
Tomasz Duszynski, Jacopo Mondi, Jean-Baptiste Maneyrol,
Mudit Sharma, Javier Carrasco, Ondřej Jirman,
Andreas Klinger, Petre Rodan, linux-iio, linux-kernel,
linux-arm-kernel, linux-mediatek, linux-stm32, Pavel Machek
On Thu, Jun 12, 2025 at 3:12 PM Nicolas Frattaroli
<nicolas.frattaroli@collabora.com> wrote:
> I thought I'd chime in as someone uninvolved because this seemed
> interesting.
Welcome! Other opinions on such a topic are always appreciated.
> On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> >
> > > Jonathan mentioned recently that he would like to get away from using
> > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > have it on good authority that initializing a struct or array with = { }
> > > is the preferred way to do this in the kernel [1]. So here is a series
> > > to take care of that.
> >
> > 1) Is it worth the churn?
> >
> > 2) Will this fail to initialize padding with some obscure compiler?
>
> as of right now, the only two C compilers that are supported are
> GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the kernel
> to finish a build with something else, I think the compiler not
> implementing the C standard correctly is the least of their worries.
>
> My bigger worry is that = { } is only guaranteed to be as correct as
> memset on C23, and the kernel's standard right now is C11. For that
> reason alone, I don't think memset should be moved away from for now,
> unless someone can verify that every GCC release >= 8.1 and every
> Clang release >= 13.0.1 does the right thing here regardless.
>
> >
> > 3) Why do you believe that {} is the preffered way? All we have is
> > Kees' email that explains that = {} maybe works in configs he tested.
>
> = { } is guaranteed to work in C23, as per the standard, but again we're
> not on C23.
>
> The reason to prefer this is likely that it's easier for static analysis
> to see the struct as initialised, but that's me making assumptions here.
>
> A more human-centric argument is that once we're on a C standards version
> where = { } is guaranteed to be correct, then = { } is much more obviously
> correct to a reader than a memset with a value and a size somewhere later
> in the code. This argument is evident from the number of patches in this
> series where the memset and the declaration are not in the same hunk.
> That's the kind of stuff that keeps me awake at night, sweating profusely.
While all you said seems true and I agree with, the pedantism here is
not needed as in the Linux kernel we have {} used for ages in tons of
code and if something went wrong with that we should have had bug
reports already. Are you aware of such? Personally I haven't heard
even one related to this. But if you know, I am really more than
interested to read about (please, give pointers to such a discussion).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
` (29 preceding siblings ...)
2025-06-12 9:17 ` Pavel Machek
@ 2025-06-12 12:51 ` Andy Shevchenko
30 siblings, 0 replies; 46+ messages in thread
From: Andy Shevchenko @ 2025-06-12 12:51 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-rockchip,
linux-stm32
On Wed, Jun 11, 2025 at 05:38:52PM -0500, David Lechner wrote:
> Jonathan mentioned recently that he would like to get away from using
> memset() to zero-initialize stack memory in the IIO subsystem. And we
> have it on good authority that initializing a struct or array with = { }
> is the preferred way to do this in the kernel [1]. So here is a series
> to take care of that.
I believe we may do that independently of the compilers that can leave garbage
in the padding. In case it happens, it will be good adventure to fix the bugs
in the code, that for some reason take padding(s) into account for the real
values.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 12:11 ` Nicolas Frattaroli
2025-06-12 12:28 ` Andy Shevchenko
@ 2025-06-12 18:54 ` Pavel Machek
2025-06-12 19:10 ` Andy Shevchenko
1 sibling, 1 reply; 46+ messages in thread
From: Pavel Machek @ 2025-06-12 18:54 UTC (permalink / raw)
To: Nicolas Frattaroli
Cc: David Lechner, linux-rockchip, Michael Hennerich,
Lars-Peter Clausen, Jonathan Cameron, Nuno Sá,
Andy Shevchenko, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Maxime Coquelin, Alexandre Torgue,
Francesco Dolcini, João Paulo Gonçalves,
Leonard Göhrs, kernel, Oleksij Rempel, Roan van Dijk,
Tomasz Duszynski, Jacopo Mondi, Jean-Baptiste Maneyrol,
Mudit Sharma, Javier Carrasco, Ondřej Jirman,
Andreas Klinger, Petre Rodan, linux-iio, linux-kernel,
linux-arm-kernel, linux-mediatek, linux-stm32
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
Hi1
> I thought I'd chime in as someone uninvolved because this seemed
> interesting.
>
> On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> > Hi!
> >
> > > Jonathan mentioned recently that he would like to get away from using
> > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > have it on good authority that initializing a struct or array with = { }
> > > is the preferred way to do this in the kernel [1]. So here is a series
> > > to take care of that.
> >
> > 1) Is it worth the churn?
> >
> > 2) Will this fail to initialize padding with some obscure compiler?
>
> as of right now, the only two C compilers that are supported are
> GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the
> kernel
Well... I'm pretty sure parts of this would make it into -stable as a
dependency, or because AUTOSEL decides it is a bugfix. So..
GNU C 4.9 gcc --version
Clang/LLVM (optional) 10.0.1 clang --version
:-).
Best regards,
Pavel
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 18:54 ` Pavel Machek
@ 2025-06-12 19:10 ` Andy Shevchenko
2025-06-14 6:47 ` Pavel Machek
0 siblings, 1 reply; 46+ messages in thread
From: Andy Shevchenko @ 2025-06-12 19:10 UTC (permalink / raw)
To: Pavel Machek
Cc: Nicolas Frattaroli, David Lechner, linux-rockchip,
Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
On Thu, Jun 12, 2025 at 08:54:07PM +0200, Pavel Machek wrote:
> > On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> > >
> > > > Jonathan mentioned recently that he would like to get away from using
> > > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > > have it on good authority that initializing a struct or array with = { }
> > > > is the preferred way to do this in the kernel [1]. So here is a series
> > > > to take care of that.
> > >
> > > 1) Is it worth the churn?
> > >
> > > 2) Will this fail to initialize padding with some obscure compiler?
> >
> > as of right now, the only two C compilers that are supported are
> > GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the
> > kernel
>
> Well... I'm pretty sure parts of this would make it into -stable as a
> dependency, or because AUTOSEL decides it is a bugfix. So..
>
> GNU C 4.9 gcc --version
> Clang/LLVM (optional) 10.0.1 clang --version
Even though, what the kernel versions are you referring to? I am sure there
plenty of cases with {} there.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-12 19:10 ` Andy Shevchenko
@ 2025-06-14 6:47 ` Pavel Machek
2025-06-14 12:18 ` Jonathan Cameron
0 siblings, 1 reply; 46+ messages in thread
From: Pavel Machek @ 2025-06-14 6:47 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Nicolas Frattaroli, David Lechner, linux-rockchip,
Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
On Thu 2025-06-12 22:10:07, Andy Shevchenko wrote:
> On Thu, Jun 12, 2025 at 08:54:07PM +0200, Pavel Machek wrote:
> > > On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> > > >
> > > > > Jonathan mentioned recently that he would like to get away from using
> > > > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > > > have it on good authority that initializing a struct or array with = { }
> > > > > is the preferred way to do this in the kernel [1]. So here is a series
> > > > > to take care of that.
> > > >
> > > > 1) Is it worth the churn?
> > > >
> > > > 2) Will this fail to initialize padding with some obscure compiler?
> > >
> > > as of right now, the only two C compilers that are supported are
> > > GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the
> > > kernel
> >
> > Well... I'm pretty sure parts of this would make it into -stable as a
> > dependency, or because AUTOSEL decides it is a bugfix. So..
> >
> > GNU C 4.9 gcc --version
> > Clang/LLVM (optional) 10.0.1 clang --version
>
> Even though, what the kernel versions are you referring to? I am sure there
> plenty of cases with {} there.
5.10, for example. I'm sure they are, uninitialized padding is a
security hole, but rather hard to detect if they are not specifically
looking.
BR,
Pavel
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-14 6:47 ` Pavel Machek
@ 2025-06-14 12:18 ` Jonathan Cameron
2025-06-14 14:18 ` Jonathan Cameron
0 siblings, 1 reply; 46+ messages in thread
From: Jonathan Cameron @ 2025-06-14 12:18 UTC (permalink / raw)
To: Pavel Machek
Cc: Andy Shevchenko, Nicolas Frattaroli, David Lechner,
linux-rockchip, Michael Hennerich, Lars-Peter Clausen,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
On Sat, 14 Jun 2025 08:47:25 +0200
Pavel Machek <pavel@ucw.cz> wrote:
> On Thu 2025-06-12 22:10:07, Andy Shevchenko wrote:
> > On Thu, Jun 12, 2025 at 08:54:07PM +0200, Pavel Machek wrote:
> > > > On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> > > > >
> > > > > > Jonathan mentioned recently that he would like to get away from using
> > > > > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > > > > have it on good authority that initializing a struct or array with = { }
> > > > > > is the preferred way to do this in the kernel [1]. So here is a series
> > > > > > to take care of that.
> > > > >
> > > > > 1) Is it worth the churn?
> > > > >
> > > > > 2) Will this fail to initialize padding with some obscure compiler?
> > > >
> > > > as of right now, the only two C compilers that are supported are
> > > > GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the
> > > > kernel
> > >
> > > Well... I'm pretty sure parts of this would make it into -stable as a
> > > dependency, or because AUTOSEL decides it is a bugfix. So..
> > >
> > > GNU C 4.9 gcc --version
> > > Clang/LLVM (optional) 10.0.1 clang --version
> >
> > Even though, what the kernel versions are you referring to? I am sure there
> > plenty of cases with {} there.
>
> 5.10, for example. I'm sure they are, uninitialized padding is a
> security hole, but rather hard to detect if they are not specifically
> looking.
The stack kunit test is there back to 5.0-rc4
50ceaa95ea09 ("lib: Introduce test_stackinit module")
So I think we should be pretty well defended against issues.
Hence I plan to pick this up curently.
Thanks all for inputs on this.
Fun corners of the C spec vs implementations!
Jonathan
>
> BR,
> Pavel
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 16/28] iio: imu: inv_icm42600: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 16/28] iio: imu: inv_icm42600: " David Lechner
@ 2025-06-14 12:21 ` Jonathan Cameron
0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Cameron @ 2025-06-14 12:21 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Nuno Sá,
Andy Shevchenko, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Maxime Coquelin, Alexandre Torgue,
Francesco Dolcini, João Paulo Gonçalves,
Leonard Göhrs, kernel, Oleksij Rempel, Roan van Dijk,
Tomasz Duszynski, Jacopo Mondi, Jean-Baptiste Maneyrol,
Mudit Sharma, Javier Carrasco, Ondřej Jirman,
Andreas Klinger, Petre Rodan, linux-iio, linux-kernel,
linux-arm-kernel, linux-mediatek, linux-rockchip, linux-stm32
On Wed, 11 Jun 2025 17:39:08 -0500
David Lechner <dlechner@baylibre.com> wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
This one isn't as obvious as many as the zeroing was in a loop
and now it's at declaration.
It's fine because we always copy over the same elements.
I'll leave this whole series a little longer in case we are missing
subtle cases like this. (but ones where it actually does make a difference!)
Jonathan
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++---
> drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++---
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> index e6cd9dcb0687d19554e63a69dc60f065c58d70ee..dbd315ad3c4d2bd5085f7cd3cdc6de4391b1c896 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> @@ -902,7 +902,8 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
> const int8_t *temp;
> unsigned int odr;
> int64_t ts_val;
> - struct inv_icm42600_accel_buffer buffer;
> + /* buffer is copied to userspace, zeroing it to avoid any data leak */
> + struct inv_icm42600_accel_buffer buffer = { };
>
> /* parse all fifo packets */
> for (i = 0, no = 0; i < st->fifo.count; i += size, ++no) {
> @@ -921,8 +922,6 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
> inv_sensors_timestamp_apply_odr(ts, st->fifo.period,
> st->fifo.nb.total, no);
>
> - /* buffer is copied to userspace, zeroing it to avoid any data leak */
> - memset(&buffer, 0, sizeof(buffer));
> memcpy(&buffer.accel, accel, sizeof(buffer.accel));
> /* convert 8 bits FIFO temperature in high resolution format */
> buffer.temp = temp ? (*temp * 64) : 0;
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> index b4d7ce1432a4f4d096599877040a89ede0625e0b..4058eca076d8b03a2290535eedffa0a74098d739 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
> @@ -806,7 +806,8 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)
> const int8_t *temp;
> unsigned int odr;
> int64_t ts_val;
> - struct inv_icm42600_gyro_buffer buffer;
> + /* buffer is copied to userspace, zeroing it to avoid any data leak */
> + struct inv_icm42600_gyro_buffer buffer = { };
>
> /* parse all fifo packets */
> for (i = 0, no = 0; i < st->fifo.count; i += size, ++no) {
> @@ -825,8 +826,6 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)
> inv_sensors_timestamp_apply_odr(ts, st->fifo.period,
> st->fifo.nb.total, no);
>
> - /* buffer is copied to userspace, zeroing it to avoid any data leak */
> - memset(&buffer, 0, sizeof(buffer));
> memcpy(&buffer.gyro, gyro, sizeof(buffer.gyro));
> /* convert 8 bits FIFO temperature in high resolution format */
> buffer.temp = temp ? (*temp * 64) : 0;
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 25/28] iio: pressure: mprls0025pa: use = { } instead of memset()
2025-06-11 22:39 ` [PATCH 25/28] iio: pressure: mprls0025pa: " David Lechner
@ 2025-06-14 12:23 ` Jonathan Cameron
0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Cameron @ 2025-06-14 12:23 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Lars-Peter Clausen, Nuno Sá,
Andy Shevchenko, Matthias Brugger, AngeloGioacchino Del Regno,
Heiko Stuebner, Maxime Coquelin, Alexandre Torgue,
Francesco Dolcini, João Paulo Gonçalves,
Leonard Göhrs, kernel, Oleksij Rempel, Roan van Dijk,
Tomasz Duszynski, Jacopo Mondi, Jean-Baptiste Maneyrol,
Mudit Sharma, Javier Carrasco, Ondřej Jirman,
Andreas Klinger, Petre Rodan, linux-iio, linux-kernel,
linux-arm-kernel, linux-mediatek, linux-rockchip, linux-stm32
On Wed, 11 Jun 2025 17:39:17 -0500
David Lechner <dlechner@baylibre.com> wrote:
> Use { } instead of memset() to zero-initialize stack memory to simplify
> the code.
>
> The initialize of the cmd value is trivial so it can be moved to the
> array initializer as well.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> drivers/iio/pressure/mprls0025pa_i2c.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/iio/pressure/mprls0025pa_i2c.c b/drivers/iio/pressure/mprls0025pa_i2c.c
> index 1a48f8d43d716b28b8fceb8e1a06d63a73a74a86..79811fd4a02b370b3fde8bd67a5115a3934f8614 100644
> --- a/drivers/iio/pressure/mprls0025pa_i2c.c
> +++ b/drivers/iio/pressure/mprls0025pa_i2c.c
> @@ -44,10 +44,7 @@ static int mpr_i2c_write(struct mpr_data *data, const u8 cmd, const u8 unused)
> {
> int ret;
> struct i2c_client *client = to_i2c_client(data->dev);
> - u8 wdata[MPR_PKT_SYNC_LEN];
> -
> - memset(wdata, 0, sizeof(wdata));
> - wdata[0] = cmd;
> + u8 wdata[MPR_PKT_SYNC_LEN] = { cmd };
Slight preference for trailing comma after cmd,
>
> ret = i2c_master_send(client, wdata, MPR_PKT_SYNC_LEN);
> if (ret < 0)
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH 00/28] iio: zero init stack with { } instead of memset()
2025-06-14 12:18 ` Jonathan Cameron
@ 2025-06-14 14:18 ` Jonathan Cameron
0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Cameron @ 2025-06-14 14:18 UTC (permalink / raw)
To: Pavel Machek
Cc: Andy Shevchenko, Nicolas Frattaroli, David Lechner,
linux-rockchip, Michael Hennerich, Lars-Peter Clausen,
Nuno Sá, Andy Shevchenko, Matthias Brugger,
AngeloGioacchino Del Regno, Heiko Stuebner, Maxime Coquelin,
Alexandre Torgue, Francesco Dolcini,
João Paulo Gonçalves, Leonard Göhrs, kernel,
Oleksij Rempel, Roan van Dijk, Tomasz Duszynski, Jacopo Mondi,
Jean-Baptiste Maneyrol, Mudit Sharma, Javier Carrasco,
Ondřej Jirman, Andreas Klinger, Petre Rodan, linux-iio,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
On Sat, 14 Jun 2025 13:18:44 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Sat, 14 Jun 2025 08:47:25 +0200
> Pavel Machek <pavel@ucw.cz> wrote:
>
> > On Thu 2025-06-12 22:10:07, Andy Shevchenko wrote:
> > > On Thu, Jun 12, 2025 at 08:54:07PM +0200, Pavel Machek wrote:
> > > > > On Thursday, 12 June 2025 11:17:52 Central European Summer Time Pavel Machek wrote:
> > > > > >
> > > > > > > Jonathan mentioned recently that he would like to get away from using
> > > > > > > memset() to zero-initialize stack memory in the IIO subsystem. And we
> > > > > > > have it on good authority that initializing a struct or array with = { }
> > > > > > > is the preferred way to do this in the kernel [1]. So here is a series
> > > > > > > to take care of that.
> > > > > >
> > > > > > 1) Is it worth the churn?
> > > > > >
> > > > > > 2) Will this fail to initialize padding with some obscure compiler?
> > > > >
> > > > > as of right now, the only two C compilers that are supported are
> > > > > GCC >= 8.1, and Clang >= 13.0.1. If anyone even manages to get the
> > > > > kernel
> > > >
> > > > Well... I'm pretty sure parts of this would make it into -stable as a
> > > > dependency, or because AUTOSEL decides it is a bugfix. So..
> > > >
> > > > GNU C 4.9 gcc --version
> > > > Clang/LLVM (optional) 10.0.1 clang --version
> > >
> > > Even though, what the kernel versions are you referring to? I am sure there
> > > plenty of cases with {} there.
> >
> > 5.10, for example. I'm sure they are, uninitialized padding is a
> > security hole, but rather hard to detect if they are not specifically
> > looking.
>
> The stack kunit test is there back to 5.0-rc4
> 50ceaa95ea09 ("lib: Introduce test_stackinit module")
>
> So I think we should be pretty well defended against issues.
>
> Hence I plan to pick this up curently.
>
> Thanks all for inputs on this.
>
> Fun corners of the C spec vs implementations!
>
> Jonathan
>
I want to give this some testing exposure from 0-day etc in case
we missed any build related issues so I've queued it up on my testing branch.
I can still pick up tags / rebase etc for now.
Thanks,
Jonathan
> >
> > BR,
> > Pavel
>
>
^ permalink raw reply [flat|nested] 46+ messages in thread
end of thread, other threads:[~2025-06-14 14:18 UTC | newest]
Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 22:38 [PATCH 00/28] iio: zero init stack with { } instead of memset() David Lechner
2025-06-11 22:38 ` [PATCH 01/28] iio: accel: adxl372: use = " David Lechner
2025-06-11 22:38 ` [PATCH 02/28] iio: accel: msa311: " David Lechner
2025-06-11 22:38 ` [PATCH 03/28] iio: adc: dln2-adc: " David Lechner
2025-06-11 22:38 ` [PATCH 04/28] iio: adc: mt6360-adc: " David Lechner
2025-06-11 22:38 ` [PATCH 05/28] iio: adc: rockchip_saradc: " David Lechner
2025-06-11 22:38 ` [PATCH 06/28] iio: adc: rtq6056: " David Lechner
2025-06-11 22:38 ` [PATCH 07/28] iio: adc: stm32-adc: " David Lechner
2025-06-11 22:39 ` [PATCH 08/28] iio: adc: ti-ads1015: " David Lechner
2025-06-11 22:39 ` [PATCH 09/28] iio: adc: ti-ads1119: " David Lechner
2025-06-12 8:16 ` Francesco Dolcini
2025-06-11 22:39 ` [PATCH 10/28] iio: adc: ti-lmp92064: " David Lechner
2025-06-12 5:41 ` Leonard Göhrs
2025-06-11 22:39 ` [PATCH 11/28] iio: adc: ti-tsc2046: " David Lechner
2025-06-12 4:30 ` Oleksij Rempel
2025-06-11 22:39 ` [PATCH 12/28] iio: chemical: scd4x: " David Lechner
2025-06-11 22:39 ` [PATCH 13/28] iio: chemical: scd30: " David Lechner
2025-06-11 22:39 ` [PATCH 14/28] iio: chemical: sunrise_co2: " David Lechner
2025-06-11 22:39 ` [PATCH 15/28] iio: dac: ad3552r: " David Lechner
2025-06-11 22:39 ` [PATCH 16/28] iio: imu: inv_icm42600: " David Lechner
2025-06-14 12:21 ` Jonathan Cameron
2025-06-11 22:39 ` [PATCH 17/28] iio: imu: inv_mpu6050: " David Lechner
2025-06-11 22:39 ` [PATCH 18/28] iio: light: bh1745: " David Lechner
2025-06-11 22:39 ` [PATCH 19/28] iio: light: ltr501: " David Lechner
2025-06-11 22:39 ` [PATCH 20/28] iio: light: opt4060: " David Lechner
2025-06-11 22:39 ` [PATCH 21/28] iio: light: veml6030: " David Lechner
2025-06-12 3:28 ` Javier Carrasco
2025-06-11 22:39 ` [PATCH 22/28] iio: magnetometer: af8133j: " David Lechner
2025-06-11 22:39 ` [PATCH 23/28] iio: pressure: bmp280: " David Lechner
2025-06-11 22:39 ` [PATCH 24/28] iio: pressure: mpl3115: " David Lechner
2025-06-11 22:39 ` [PATCH 25/28] iio: pressure: mprls0025pa: " David Lechner
2025-06-14 12:23 ` Jonathan Cameron
2025-06-11 22:39 ` [PATCH 26/28] iio: pressure: zpa2326: " David Lechner
2025-06-11 22:39 ` [PATCH 27/28] iio: proximity: irsd200: " David Lechner
2025-06-11 22:39 ` [PATCH 28/28] iio: temperature: tmp006: " David Lechner
2025-06-12 6:09 ` [PATCH 00/28] iio: zero init stack with " Nuno Sá
2025-06-12 9:17 ` Pavel Machek
2025-06-12 10:45 ` Jonathan Cameron
2025-06-12 12:11 ` Nicolas Frattaroli
2025-06-12 12:28 ` Andy Shevchenko
2025-06-12 18:54 ` Pavel Machek
2025-06-12 19:10 ` Andy Shevchenko
2025-06-14 6:47 ` Pavel Machek
2025-06-14 12:18 ` Jonathan Cameron
2025-06-14 14:18 ` Jonathan Cameron
2025-06-12 12:51 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).