drivers/platform/chrome/wilco_ec/event.c:99: warning: Excess struct member 'entries' description in 'ec_event_queue'

From: kernel test robot
Date: Thu Dec 14 2023 - 12:25:40 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd
commit: 1aa8df90f4569acd36d2c94a9cfe1eee561575d6 platform/chrome: wilco_ec: Annotate struct ec_event_queue with __counted_by
date: 3 months ago
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20231215/202312150101.lovwMZzT-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231215/202312150101.lovwMZzT-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/oe-kbuild-all/202312150101.lovwMZzT-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/platform/chrome/wilco_ec/event.c:99: warning: Excess struct member 'entries' description in 'ec_event_queue'


vim +99 drivers/platform/chrome/wilco_ec/event.c

1d333ef3d59902 Nick Crews 2019-06-24 86
1d333ef3d59902 Nick Crews 2019-06-24 87 /**
1d333ef3d59902 Nick Crews 2019-06-24 88 * struct ec_event_queue - Circular queue for events.
1d333ef3d59902 Nick Crews 2019-06-24 89 * @capacity: Number of elements the queue can hold.
1d333ef3d59902 Nick Crews 2019-06-24 90 * @head: Next index to write to.
1d333ef3d59902 Nick Crews 2019-06-24 91 * @tail: Next index to read from.
1d333ef3d59902 Nick Crews 2019-06-24 92 * @entries: Array of events.
1d333ef3d59902 Nick Crews 2019-06-24 93 */
1d333ef3d59902 Nick Crews 2019-06-24 94 struct ec_event_queue {
1d333ef3d59902 Nick Crews 2019-06-24 95 int capacity;
1d333ef3d59902 Nick Crews 2019-06-24 96 int head;
1d333ef3d59902 Nick Crews 2019-06-24 97 int tail;
1aa8df90f4569a Kees Cook 2023-09-22 98 struct ec_event *entries[] __counted_by(capacity);
1d333ef3d59902 Nick Crews 2019-06-24 @99 };
1d333ef3d59902 Nick Crews 2019-06-24 100

:::::: The code at line 99 was first introduced by commit
:::::: 1d333ef3d599026897fb11b4f89f9f8f30838139 platform/chrome: wilco_ec: Add circular buffer as event queue

:::::: TO: Nick Crews <ncrews@xxxxxxxxxxxx>
:::::: CC: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx>

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