[PATCH] iio: accel: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replacing zero-length arrays with C99 flexible-array
members since they are obsolete.
Use the new DECLARE_FLEX_ARRAY() auxiliary macro instead
of defining a zero-length array.

This fixes warnings such as:
./drivers/iio/accel/adxl367_spi.c:38:6-17: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)

Signed-off-by: Atul Raut <rauji.raut@xxxxxxxxx>
---
 drivers/iio/accel/adxl367_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl367_spi.c b/drivers/iio/accel/adxl367_spi.c
index 118c894015a5..9dc61cb45fc5 100644
--- a/drivers/iio/accel/adxl367_spi.c
+++ b/drivers/iio/accel/adxl367_spi.c
@@ -35,7 +35,7 @@ struct adxl367_spi_state {
 	 */
 	u8			reg_write_tx_buf[1] __aligned(IIO_DMA_MINALIGN);
 	u8			reg_read_tx_buf[2];
-	u8			fifo_tx_buf[1];
+	DECLARE_FLEX_ARRAY(u8,			fifo_tx_buf);
 };
 
 static int adxl367_read_fifo(void *context, __be16 *fifo_buf,
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux