Skip to content

Commit 1006ebe

Browse files
atulrautgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c471245 commit 1006ebe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvmem/u-boot-env.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct u_boot_env_image_broadcom {
4747
__le32 magic;
4848
__le32 len;
4949
__le32 crc32;
50-
uint8_t data[0];
50+
DECLARE_FLEX_ARRAY(uint8_t, data);
5151
} __packed;
5252

5353
static int u_boot_env_read(void *context, unsigned int offset, void *val,

0 commit comments

Comments
 (0)