[gustavoars:testing/wfamnae-next20240710-cbc 1/13] drivers/leds/leds-cros_ec.c:70:40: warning: structure containing a flexible array member is not at the end of another structure

From: kernel test robot
Date: Fri Jul 12 2024 - 00:19:31 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20240710-cbc
head: 73efb8d9b6a2ba4b07021861a1760ec742ddf432
commit: d692eacf807861f523e66bd7d1c60f5dc254f4c6 [1/13] Makefile: Enable -Wflex-array-member-not-at-end globally
:::::: branch date: 8 hours ago
:::::: commit date: 9 hours ago
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240711/202407112258.ZvWw5uJq-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240711/202407112258.ZvWw5uJq-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202407112258.ZvWw5uJq-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/leds/leds-cros_ec.c: In function 'cros_ec_led_send_cmd':
>> drivers/leds/leds-cros_ec.c:70:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
70 | struct cros_ec_command msg;
| ^~~


vim +70 drivers/leds/leds-cros_ec.c

8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 64
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 65 static int cros_ec_led_send_cmd(struct cros_ec_device *cros_ec,
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 66 union cros_ec_led_cmd_data *arg)
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 67 {
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 68 int ret;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 69 struct {
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 @70 struct cros_ec_command msg;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 71 union cros_ec_led_cmd_data data;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 72 } __packed buf = {
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 73 .msg = {
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 74 .version = 1,
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 75 .command = EC_CMD_LED_CONTROL,
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 76 .insize = sizeof(arg->resp),
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 77 .outsize = sizeof(arg->req),
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 78 },
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 79 .data.req = arg->req
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 80 };
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 81
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 82 ret = cros_ec_cmd_xfer_status(cros_ec, &buf.msg);
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 83 if (ret < 0)
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 84 return ret;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 85
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 86 arg->resp = buf.data.resp;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 87
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 88 return 0;
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 89 }
8d6ce6f3ec9d5f Thomas Weißschuh 2024-06-13 90

:::::: The code at line 70 was first introduced by commit
:::::: 8d6ce6f3ec9d5f384e3eac92e43cfeac7a36e6b1 leds: Add ChromeOS EC driver

:::::: TO: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
:::::: CC: Lee Jones <lee@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki