platform/chrome: lightbar: Remove [0]
PATCH 1/1 platform/chrome: lightbar: Remove [0]
Variable arrays should be defined as [], not [0], otherwise the kernel complains:
memcpy : detected field-spanning write (size 9) of single field "param->set_program_ex.data" at drivers/platform/chrome/cros_ec_lightbar.c:603 (size 0)
--- include/linux/platform_data/cros_ec_commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/platform_data/cros_ec_commands.h +1 -1
@@ -2028,7 +2028,7 @@ struct lightbar_program {struct lightbar_program_ex {uint8_t size;uint16_t offset; -uint8_t data[0 ]; +uint8_t data[]; } __ec_todo_packed;struct ec_params_lightbar {
Signature · 1 line
2.53.0.rc2.204.g2597b5adb4-goog
Quoted 4 lines · Gwendal Grignou
Variable arrays should be defined as [], not [0], otherwise the kernel complains:
memcpy : detected field-spanning write (size 9) of single field "
param->set_program_ex.data" atdrivers/platform/chrome/cros_ec_lightbar.c:603(size 0)
Oops, https://lore.kernel.org/all/[email protected]/ raised the concern but we haven't addressed it.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
[1/1] platform/chrome: lightbar: Remove [0]
commit: 520e345dfdab89aed4a0ad98d5ec35086661a11a
Thanks!