[agd5f:drm-next-7.3 220/308] drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:274:15: sparse: sparse: incorrect type in assignment (different base types)

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
Hi YiPeng,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://gitlab.freedesktop.org/agd5f/linux.git drm-next-7.3
head:   daaeec235e46b45a0dbd4facfb275cc43022028d
commit: d95700604fbc6fd7534303796d005e6efbd1d591 [220/308] drm/amd/ras: rename core ras_* files and update include guards
config: riscv-randconfig-r111-20260807 (https://download.01.org/0day-ci/archive/20260809/[email protected]/config)
compiler: riscv64-linux-gcc (GCC) 16.1.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260809/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:274:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:274:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:274:15: sparse:     got restricted __le32 [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:275:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:275:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:275:15: sparse:     got restricted __le32 [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:276:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:276:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:276:15: sparse:     got restricted __le32 [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:277:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:277:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:277:15: sparse:     got restricted __le32 [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:278:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:278:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:278:15: sparse:     got restricted __le32 [usertype]
>> drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:287:33: sparse: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:288:33: sparse: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:289:33: sparse: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:290:33: sparse: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:291:33: sparse: sparse: cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:333:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] @@     got restricted __le32 [usertype] @@
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:333:15: sparse:     expected unsigned int [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:333:15: sparse:     got restricted __le32 [usertype]
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c:343:15: sparse: sparse: cast to restricted __le32
--
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom_fw.c:115:68: sparse: sparse: Using plain integer as NULL pointer
   drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom_fw.c:367:56: sparse: sparse: Using plain integer as NULL pointer

vim +274 drivers/gpu/drm/amd/amdgpu/../ras/core/eeprom.c

5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  267  
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  268  static void
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  269  __encode_table_header_to_buf(struct ras_eeprom_table_header *hdr,
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  270  			     unsigned char *buf)
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  271  {
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  272  	u32 *pp = (uint32_t *)buf;
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  273  
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17 @274  	pp[0] = cpu_to_le32(hdr->header);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  275  	pp[1] = cpu_to_le32(hdr->version);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  276  	pp[2] = cpu_to_le32(hdr->first_rec_offset);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  277  	pp[3] = cpu_to_le32(hdr->tbl_size);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  278  	pp[4] = cpu_to_le32(hdr->checksum);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  279  }
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  280  
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  281  static void
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  282  __decode_table_header_from_buf(struct ras_eeprom_table_header *hdr,
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  283  			       unsigned char *buf)
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  284  {
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  285  	u32 *pp = (uint32_t *)buf;
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  286  
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17 @287  	hdr->header	      = le32_to_cpu(pp[0]);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  288  	hdr->version	      = le32_to_cpu(pp[1]);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  289  	hdr->first_rec_offset = le32_to_cpu(pp[2]);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  290  	hdr->tbl_size	      = le32_to_cpu(pp[3]);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  291  	hdr->checksum	      = le32_to_cpu(pp[4]);
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  292  }
5c3be5defc926ba drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c YiPeng Chai 2025-03-17  293  

:::::: The code at line 274 was first introduced by commit
:::::: 5c3be5defc926ba8970bc3d1c26a14adad2b8a7a drm/amd/ras: Add eeprom ras functions

:::::: TO: YiPeng Chai <[email protected]>
:::::: CC: Alex Deucher <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.