include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list')

From: kernel test robot
Date: Tue May 21 2024 - 04:10:29 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8f6a15f095a63a83b096d9b29aaff4f0fbe6f6e6
commit: dd08ebf6c3525a7ea2186e636df064ea47281987 drm/xe: Introduce a new DRM driver for Intel GPUs
date: 5 months ago
config: riscv-randconfig-002-20240521 (https://download.01.org/0day-ci/archive/20240521/202405211551.VnBA7xye-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fa9b1be45088dce1e4b602d451f118128b94237b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240521/202405211551.VnBA7xye-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/202405211551.VnBA7xye-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from <built-in>:4:
In file included from drivers/gpu/drm/xe/xe_uc_types.h:9:
In file included from drivers/gpu/drm/xe/xe_guc_types.h:13:
In file included from drivers/gpu/drm/xe/xe_guc_ct_types.h:10:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
1 error generated.
--
In file included from drivers/gpu/drm/xe/xe_pcode.c:9:
In file included from drivers/gpu/drm/xe/xe_gt.h:9:
In file included from include/drm/drm_util.h:35:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_pcode.c:74:44: error: variable 'timeout' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
74 | _wait_for_atomic(pcode_mailbox_done(gt), timeout * 1000, 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_utils.h:299:27: note: expanded from macro '_wait_for_atomic'
299 | int cpu, ret, timeout = (US) * 1000; \
| ~~~~~~~ ^~
2 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_wait_user_fence.c:7:
In file included from include/drm/drm_file.h:39:
In file included from include/drm/drm_prime.h:37:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_wait_user_fence.c:59:5: error: no previous prototype for function 'check_hw_engines' [-Werror,-Wmissing-prototypes]
59 | int check_hw_engines(struct xe_device *xe,
| ^
drivers/gpu/drm/xe/xe_wait_user_fence.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
59 | int check_hw_engines(struct xe_device *xe,
| ^
| static
drivers/gpu/drm/xe/xe_wait_user_fence.c:85:5: error: no previous prototype for function 'xe_wait_user_fence_ioctl' [-Werror,-Wmissing-prototypes]
85 | int xe_wait_user_fence_ioctl(struct drm_device *dev, void *data,
| ^
drivers/gpu/drm/xe/xe_wait_user_fence.c:85:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
85 | int xe_wait_user_fence_ioctl(struct drm_device *dev, void *data,
| ^
| static
3 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_irq.c:10:
In file included from drivers/gpu/drm/xe/xe_device.h:12:
In file included from include/drm/drm_util.h:35:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_irq.c:451:6: error: no previous prototype for function 'xe_irq_reset' [-Werror,-Wmissing-prototypes]
451 | void xe_irq_reset(struct xe_device *xe)
| ^
drivers/gpu/drm/xe/xe_irq.c:451:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
451 | void xe_irq_reset(struct xe_device *xe)
| ^
| static
drivers/gpu/drm/xe/xe_irq.c:467:6: error: no previous prototype for function 'xe_gt_irq_postinstall' [-Werror,-Wmissing-prototypes]
467 | void xe_gt_irq_postinstall(struct xe_gt *gt)
| ^
drivers/gpu/drm/xe/xe_irq.c:467:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
467 | void xe_gt_irq_postinstall(struct xe_gt *gt)
| ^
| static
drivers/gpu/drm/xe/xe_irq.c:515:5: error: no previous prototype for function 'xe_irq_install' [-Werror,-Wmissing-prototypes]
515 | int xe_irq_install(struct xe_device *xe)
| ^
drivers/gpu/drm/xe/xe_irq.c:515:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
515 | int xe_irq_install(struct xe_device *xe)
| ^
| static
drivers/gpu/drm/xe/xe_irq.c:545:6: error: no previous prototype for function 'xe_irq_shutdown' [-Werror,-Wmissing-prototypes]
545 | void xe_irq_shutdown(struct xe_device *xe)
| ^
drivers/gpu/drm/xe/xe_irq.c:545:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
545 | void xe_irq_shutdown(struct xe_device *xe)
| ^
| static
drivers/gpu/drm/xe/xe_irq.c:550:6: error: no previous prototype for function 'xe_irq_suspend' [-Werror,-Wmissing-prototypes]
550 | void xe_irq_suspend(struct xe_device *xe)
| ^
drivers/gpu/drm/xe/xe_irq.c:550:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
550 | void xe_irq_suspend(struct xe_device *xe)
| ^
| static
drivers/gpu/drm/xe/xe_irq.c:558:6: error: no previous prototype for function 'xe_irq_resume' [-Werror,-Wmissing-prototypes]
558 | void xe_irq_resume(struct xe_device *xe)
| ^
drivers/gpu/drm/xe/xe_irq.c:558:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
558 | void xe_irq_resume(struct xe_device *xe)
| ^
| static
7 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_gt_topology.c:8:
In file included from drivers/gpu/drm/xe/xe_gt.h:9:
In file included from include/drm/drm_util.h:35:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_gt_topology.c:98:1: error: no previous prototype for function 'xe_gt_topology_count_dss' [-Werror,-Wmissing-prototypes]
98 | xe_gt_topology_count_dss(xe_dss_mask_t mask)
| ^
drivers/gpu/drm/xe/xe_gt_topology.c:97:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
97 | unsigned int
| ^
| static
drivers/gpu/drm/xe/xe_gt_topology.c:104:1: error: no previous prototype for function 'xe_gt_topology_dss_group_mask' [-Werror,-Wmissing-prototypes]
104 | xe_gt_topology_dss_group_mask(xe_dss_mask_t mask, int grpsize)
| ^
drivers/gpu/drm/xe/xe_gt_topology.c:103:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
103 | u64
| ^
| static
3 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_tuning.c:9:
In file included from drivers/gpu/drm/xe/xe_gt_types.h:14:
In file included from drivers/gpu/drm/xe/xe_uc_types.h:9:
In file included from drivers/gpu/drm/xe/xe_guc_types.h:13:
In file included from drivers/gpu/drm/xe/xe_guc_ct_types.h:10:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_tuning.c:36:6: error: no previous prototype for function 'xe_tuning_process_gt' [-Werror,-Wmissing-prototypes]
36 | void xe_tuning_process_gt(struct xe_gt *gt)
| ^
drivers/gpu/drm/xe/xe_tuning.c:36:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
36 | void xe_tuning_process_gt(struct xe_gt *gt)
| ^
| static
2 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_guc_pc.c:7:
In file included from drivers/gpu/drm/xe/xe_bo.h:9:
In file included from drivers/gpu/drm/xe/xe_bo_types.h:12:
In file included from include/drm/ttm/ttm_bo.h:34:
In file included from include/drm/drm_gem.h:42:
In file included from include/drm/drm_vma_manager.h:27:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_guc_pc.c:721:5: error: no previous prototype for function 'xe_guc_pc_start' [-Werror,-Wmissing-prototypes]
721 | int xe_guc_pc_start(struct xe_guc_pc *pc)
| ^
drivers/gpu/drm/xe/xe_guc_pc.c:721:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
721 | int xe_guc_pc_start(struct xe_guc_pc *pc)
| ^
| static
drivers/gpu/drm/xe/xe_guc_pc.c:771:5: error: no previous prototype for function 'xe_guc_pc_stop' [-Werror,-Wmissing-prototypes]
771 | int xe_guc_pc_stop(struct xe_guc_pc *pc)
| ^
drivers/gpu/drm/xe/xe_guc_pc.c:771:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
771 | int xe_guc_pc_stop(struct xe_guc_pc *pc)
| ^
| static
drivers/gpu/drm/xe/xe_guc_pc.c:812:5: error: no previous prototype for function 'xe_guc_pc_init' [-Werror,-Wmissing-prototypes]
812 | int xe_guc_pc_init(struct xe_guc_pc *pc)
| ^
drivers/gpu/drm/xe/xe_guc_pc.c:812:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
812 | int xe_guc_pc_init(struct xe_guc_pc *pc)
| ^
| static
4 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_gt.c:11:
In file included from drivers/gpu/drm/xe/xe_bo.h:9:
In file included from drivers/gpu/drm/xe/xe_bo_types.h:12:
In file included from include/drm/ttm/ttm_bo.h:34:
In file included from include/drm/drm_gem.h:42:
In file included from include/drm/drm_vma_manager.h:27:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_gt.c:211:5: error: no previous prototype for function 'emit_nop_job' [-Werror,-Wmissing-prototypes]
211 | int emit_nop_job(struct xe_gt *gt, struct xe_engine *e)
| ^
drivers/gpu/drm/xe/xe_gt.c:211:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
211 | int emit_nop_job(struct xe_gt *gt, struct xe_engine *e)
| ^
| static
drivers/gpu/drm/xe/xe_gt.c:245:5: error: no previous prototype for function 'emit_wa_job' [-Werror,-Wmissing-prototypes]
245 | int emit_wa_job(struct xe_gt *gt, struct xe_engine *e)
| ^
drivers/gpu/drm/xe/xe_gt.c:245:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
245 | int emit_wa_job(struct xe_gt *gt, struct xe_engine *e)
| ^
| static
drivers/gpu/drm/xe/xe_gt.c:596:5: error: no previous prototype for function 'do_gt_reset' [-Werror,-Wmissing-prototypes]
596 | int do_gt_reset(struct xe_gt *gt)
| ^
drivers/gpu/drm/xe/xe_gt.c:596:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
596 | int do_gt_reset(struct xe_gt *gt)
| ^
| static
4 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_guc.c:6:
In file included from drivers/gpu/drm/xe/xe_bo.h:9:
In file included from drivers/gpu/drm/xe/xe_bo_types.h:12:
In file included from include/drm/ttm/ttm_bo.h:34:
In file included from include/drm/drm_gem.h:42:
In file included from include/drm/drm_vma_manager.h:27:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_guc.c:239:6: error: no previous prototype for function 'guc_write_params' [-Werror,-Wmissing-prototypes]
239 | void guc_write_params(struct xe_guc *guc)
| ^
drivers/gpu/drm/xe/xe_guc.c:239:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
239 | void guc_write_params(struct xe_guc *guc)
| ^
| static
drivers/gpu/drm/xe/xe_guc.c:574:6: error: no previous prototype for function 'guc_enable_irq' [-Werror,-Wmissing-prototypes]
574 | void guc_enable_irq(struct xe_guc *guc)
| ^
drivers/gpu/drm/xe/xe_guc.c:574:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
574 | void guc_enable_irq(struct xe_guc *guc)
| ^
| static
3 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_dma_buf.c:6:
In file included from include/linux/dma-buf.h:19:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/gpu/drm/xe/xe_dma_buf.c:306:
drivers/gpu/drm/xe/tests/xe_dma_buf.c:255:6: error: no previous prototype for function 'xe_dma_buf_kunit' [-Werror,-Wmissing-prototypes]
255 | void xe_dma_buf_kunit(struct kunit *test)
| ^
drivers/gpu/drm/xe/tests/xe_dma_buf.c:255:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
255 | void xe_dma_buf_kunit(struct kunit *test)
| ^
| static
2 errors generated.
--
In file included from drivers/gpu/drm/xe/xe_ring_ops.c:7:
In file included from drivers/gpu/drm/xe/xe_gt.h:9:
In file included from include/drm/drm_util.h:35:
In file included from include/linux/interrupt.h:21:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2177:
>> include/linux/vmstat.h:522:36: error: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Werror,-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/gpu/drm/xe/xe_ring_ops.c:288:20: error: array index 0 is past the end of the array (that has type 'u64[0]' (aka 'unsigned long long[0]')) [-Werror,-Warray-bounds]
288 | i = emit_bb_start(job->batch_addr[0], BIT(8), dw, i);
| ^ ~
drivers/gpu/drm/xe/xe_sched_job_types.h:43:2: note: array 'batch_addr' declared here
43 | u64 batch_addr[0];
| ^
drivers/gpu/drm/xe/xe_ring_ops.c:294:20: error: array index 1 is past the end of the array (that has type 'u64[0]' (aka 'unsigned long long[0]')) [-Werror,-Warray-bounds]
294 | i = emit_bb_start(job->batch_addr[1], BIT(8), dw, i);
| ^ ~
drivers/gpu/drm/xe/xe_sched_job_types.h:43:2: note: array 'batch_addr' declared here
43 | u64 batch_addr[0];
| ^
3 errors generated.
.


vim +522 include/linux/vmstat.h

9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 519
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 520 static inline const char *lru_list_name(enum lru_list lru)
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 521 {
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 @522 return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 523 }
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 524

:::::: The code at line 522 was first introduced by commit
:::::: 9d7ea9a297e6445d567056f15b469dde13ca4134 mm/vmstat: add helpers to get vmstat item names for each enum type

:::::: TO: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

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