* Re: [djiang:cxl/fwctl 13/25] drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference [not found] <202409270908.NJPL38kw-lkp@intel.com> @ 2024-09-27 13:41 ` Nathan Chancellor 2024-09-27 16:23 ` Dave Jiang 0 siblings, 1 reply; 2+ messages in thread From: Nathan Chancellor @ 2024-09-27 13:41 UTC (permalink / raw) To: kernel test robot Cc: Dave Jiang, llvm, oe-kbuild-all, Kees Cook, Gustavo A. R. Silva, linux-hardening On Fri, Sep 27, 2024 at 09:39:54AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git cxl/fwctl > head: b4f2900f53c72de8fc639b62e44763c6a9695d3b > commit: 5a0496c19151d83cd0d926f8a1488eeaab27509b [13/25] cxl: Add Get Supported Features command for kernel usage > config: arm-randconfig-004-20240927 (https://download.01.org/0day-ci/archive/20240927/202409270908.NJPL38kw-lkp@intel.com/config) > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 7773243d9916f98ba0ffce0c3a960e4aa9f03e81) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240927/202409270908.NJPL38kw-lkp@intel.com/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@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202409270908.NJPL38kw-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > In file included from drivers/cxl/port.c:7: > In file included from drivers/cxl/cxlmem.h:6: > In file included from include/linux/pci.h:1646: > In file included from include/linux/dmapool.h:14: > In file included from include/linux/scatterlist.h:8: > In file included from include/linux/mm.h:2232: > include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] > 517 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" > | ~~~~~~~~~~~ ^ ~~~ > In file included from drivers/cxl/port.c:7: > >> drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference > 798 | struct cxl_feat_entry ents[] __counted_by(le32_to_cpu(supported_feats)); > | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It seems like this should likely use the __counted_by_le() macro so that it is only used for tracking on little endian targets? > include/linux/byteorder/generic.h:89:21: note: expanded from macro 'le32_to_cpu' > 89 | #define le32_to_cpu __le32_to_cpu > | ^ > include/uapi/linux/byteorder/little_endian.h:35:26: note: expanded from macro '__le32_to_cpu' > 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) > | ^ > include/linux/compiler_attributes.h:105:62: note: expanded from macro '__counted_by' > 105 | # define __counted_by(member) __attribute__((__counted_by__(member))) > | ^~~~~~ > 1 warning and 1 error generated. > > > vim +/counted_by +798 drivers/cxl/cxlmem.h > > 793 > 794 struct cxl_mbox_get_sup_feats_out { > 795 __le16 num_entries; > 796 __le16 supported_feats; > 797 u8 reserved[4]; > > 798 struct cxl_feat_entry ents[] __counted_by(le32_to_cpu(supported_feats)); > 799 } __packed; > 800 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki > ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [djiang:cxl/fwctl 13/25] drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference 2024-09-27 13:41 ` [djiang:cxl/fwctl 13/25] drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference Nathan Chancellor @ 2024-09-27 16:23 ` Dave Jiang 0 siblings, 0 replies; 2+ messages in thread From: Dave Jiang @ 2024-09-27 16:23 UTC (permalink / raw) To: Nathan Chancellor, kernel test robot Cc: llvm, oe-kbuild-all, Kees Cook, Gustavo A. R. Silva, linux-hardening On 9/27/24 6:41 AM, Nathan Chancellor wrote: > On Fri, Sep 27, 2024 at 09:39:54AM +0800, kernel test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git cxl/fwctl >> head: b4f2900f53c72de8fc639b62e44763c6a9695d3b >> commit: 5a0496c19151d83cd0d926f8a1488eeaab27509b [13/25] cxl: Add Get Supported Features command for kernel usage >> config: arm-randconfig-004-20240927 (https://download.01.org/0day-ci/archive/20240927/202409270908.NJPL38kw-lkp@intel.com/config) >> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 7773243d9916f98ba0ffce0c3a960e4aa9f03e81) >> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240927/202409270908.NJPL38kw-lkp@intel.com/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@intel.com> >> | Closes: https://lore.kernel.org/oe-kbuild-all/202409270908.NJPL38kw-lkp@intel.com/ >> >> All errors (new ones prefixed by >>): >> >> In file included from drivers/cxl/port.c:7: >> In file included from drivers/cxl/cxlmem.h:6: >> In file included from include/linux/pci.h:1646: >> In file included from include/linux/dmapool.h:14: >> In file included from include/linux/scatterlist.h:8: >> In file included from include/linux/mm.h:2232: >> include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] >> 517 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" >> | ~~~~~~~~~~~ ^ ~~~ >> In file included from drivers/cxl/port.c:7: >>>> drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference >> 798 | struct cxl_feat_entry ents[] __counted_by(le32_to_cpu(supported_feats)); >> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > It seems like this should likely use the __counted_by_le() macro so that > it is only used for tracking on little endian targets? Thank you! That helped address the issue. > >> include/linux/byteorder/generic.h:89:21: note: expanded from macro 'le32_to_cpu' >> 89 | #define le32_to_cpu __le32_to_cpu >> | ^ >> include/uapi/linux/byteorder/little_endian.h:35:26: note: expanded from macro '__le32_to_cpu' >> 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) >> | ^ >> include/linux/compiler_attributes.h:105:62: note: expanded from macro '__counted_by' >> 105 | # define __counted_by(member) __attribute__((__counted_by__(member))) >> | ^~~~~~ >> 1 warning and 1 error generated. >> >> >> vim +/counted_by +798 drivers/cxl/cxlmem.h >> >> 793 >> 794 struct cxl_mbox_get_sup_feats_out { >> 795 __le16 num_entries; >> 796 __le16 supported_feats; >> 797 u8 reserved[4]; >> > 798 struct cxl_feat_entry ents[] __counted_by(le32_to_cpu(supported_feats)); >> 799 } __packed; >> 800 >> >> -- >> 0-DAY CI Kernel Test Service >> https://github.com/intel/lkp-tests/wiki >> ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-27 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202409270908.NJPL38kw-lkp@intel.com>
2024-09-27 13:41 ` [djiang:cxl/fwctl 13/25] drivers/cxl/cxlmem.h:798:44: error: 'counted_by' argument must be a simple declaration reference Nathan Chancellor
2024-09-27 16:23 ` Dave Jiang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox