Skip to content

Commit

Permalink
nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY…
Browse files Browse the repository at this point in the history
…() 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>
  • Loading branch information
Atul Raut authored and Greg Kroah-Hartman committed Aug 23, 2023
1 parent c471245 commit 1006ebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvmem/u-boot-env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1006ebe

Please sign in to comment.