aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorAtul Raut <rauji.raut@gmail.com>2023-08-23 14:27:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-23 16:34:02 +0200
commit1006ebe9f1b5dad6b9e8b34ca9b982cc8c16ccee (patch)
treedf5ba3a3b610b2c54826a7af861dac0bea1e530d /drivers/nvmem
parentc471245bd9f25152e398fb49f65cf6e1ed7febbd (diff)
downloadlinux-1006ebe9f1b5dad6b9e8b34ca9b982cc8c16ccee.tar.gz
nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
We are moving toward replacing zero-length arrays with C99 flexible-array members since they are deprecated. Therefore, the new DECLARE_FLEX_ARRAY() helper macro should be used to replace the zero-length array declaration. This fixes warnings such as: ./drivers/nvmem/u-boot-env.c:50:9-13: 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@gmail.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230823132744.350618-19-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/u-boot-env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
index 80c5382b361c8..c4ae94af4af78 100644
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/u-boot-env.c
@@ -47,7 +47,7 @@ struct u_boot_env_image_broadcom {
__le32 magic;
__le32 len;
__le32 crc32;
- uint8_t data[0];
+ DECLARE_FLEX_ARRAY(uint8_t, data);
} __packed;
static int u_boot_env_read(void *context, unsigned int offset, void *val,