Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:615:42: warning: arithmetic between different enumeration types ('enum amdgpu_ras_block' and 'enum amdgpu_ras_mca_block')
@ 2025-02-07 21:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-07 21:57 UTC (permalink / raw)
  Cc: oe-kbuild-all, llvm

CC: linux-kernel@vger.kernel.org
TO: John Clements <john.clements@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Hawking Zhang <Hawking.Zhang@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bb066fe812d6fb3a9d01c073d9f1e2fd5a63403b
commit: 640ae42efb828be69a9ee6ac88fb3d5a3e678ddf drm/amdgpu: Updated RAS infrastructure
date:   3 years, 5 months ago
config: x86_64-randconfig-161-20241229 (https://download.01.org/0day-ci/archive/20250208/202502080537.uHN24DQs-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250208/202502080537.uHN24DQs-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/202502080537.uHN24DQs-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:29:
   In file included from include/linux/syscalls.h:87:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:6:
   In file included from include/linux/ring_buffer.h:5:
   In file included from include/linux/mm.h:1600:
   include/linux/vmstat.h:436:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     436 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     437 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:443:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     443 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     444 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:450:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     450 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:455:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     455 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     456 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:464:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     464 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     465 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:615:42: warning: arithmetic between different enumeration types ('enum amdgpu_ras_block' and 'enum amdgpu_ras_mca_block') [-Wenum-enum-conversion]
     615 |                 for (i = 0; i < AMDGPU_RAS_BLOCK_COUNT + AMDGPU_RAS_MCA_BLOCK_COUNT; i++) {
         |                                 ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:858:6: warning: no previous prototype for function 'amdgpu_ras_mca_query_error_status' [-Wmissing-prototypes]
     858 | void amdgpu_ras_mca_query_error_status(struct amdgpu_device *adev,
         |      ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:858:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     858 | void amdgpu_ras_mca_query_error_status(struct amdgpu_device *adev,
         | ^
         | static 
   7 warnings generated.


vim +615 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

   588	
   589	/* return an obj equal to head, or the first when head is NULL */
   590	struct ras_manager *amdgpu_ras_find_obj(struct amdgpu_device *adev,
   591			struct ras_common_if *head)
   592	{
   593		struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
   594		struct ras_manager *obj;
   595		int i;
   596	
   597		if (!adev->ras_enabled || !con)
   598			return NULL;
   599	
   600		if (head) {
   601			if (head->block >= AMDGPU_RAS_BLOCK_COUNT)
   602				return NULL;
   603	
   604			if (head->block == AMDGPU_RAS_BLOCK__MCA) {
   605				if (head->sub_block_index >= AMDGPU_RAS_MCA_BLOCK__LAST)
   606					return NULL;
   607	
   608				obj = &con->objs[AMDGPU_RAS_BLOCK__LAST + head->sub_block_index];
   609			} else
   610				obj = &con->objs[head->block];
   611	
   612			if (alive_obj(obj))
   613				return obj;
   614		} else {
 > 615			for (i = 0; i < AMDGPU_RAS_BLOCK_COUNT + AMDGPU_RAS_MCA_BLOCK_COUNT; i++) {
   616				obj = &con->objs[i];
   617				if (alive_obj(obj))
   618					return obj;
   619			}
   620		}
   621	
   622		return NULL;
   623	}
   624	/* obj end */
   625	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-07 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 21:57 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:615:42: warning: arithmetic between different enumeration types ('enum amdgpu_ras_block' and 'enum amdgpu_ras_mca_block') kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox