From 7296103acacda6a7514a6215279ef5337a0e19b2 Mon Sep 17 00:00:00 2001 From: YiPeng Chai Date: Tue, 15 Sep 2026 14:52:32 +0800 Subject: [PATCH] drm/amd/ras: use __le32 pointer type to resolve the sparse warnings Use __le32 pointer type to resolve the sparse warnings. sparse warnings: ras/core/eeprom.c:275:15: sparse: expected unsigned int [usertype] ras/core/eeprom.c:275:15: sparse: got restricted __le32 [usertype] ras/core/eeprom.c:277:15: sparse: expected unsigned int [usertype] ras/core/eeprom.c:277:15: sparse: got restricted __le32 [usertype] ras/core/eeprom.c:288:33: sparse: sparse: cast to restricted __le32 ras/core/eeprom.c:289:33: sparse: sparse: cast to restricted __le32 ras/core/eeprom.c:290:33: sparse: sparse: cast to restricted __le32 ras/core/eeprom.c:291:33: sparse: sparse: cast to restricted __le32 ras/core/eeprom.c:333:15: sparse: expected unsigned int [usertype] ras/core/eeprom.c:333:15: sparse: got restricted __le32 [usertype] ras/core/eeprom.c:343:15: sparse: sparse: cast to restricted __le32 Fixes: 5c3be5defc92 ("drm/amd/ras: Add eeprom ras functions") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202609101657.kczNjTnY-lkp@intel.com/ Signed-off-by: YiPeng Chai Acked-by: Alex Deucher Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/ras/core/eeprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/ras/core/eeprom.c b/drivers/gpu/drm/amd/ras/core/eeprom.c index e7aad113b98a..efa04cd8fbe0 100644 --- a/drivers/gpu/drm/amd/ras/core/eeprom.c +++ b/drivers/gpu/drm/amd/ras/core/eeprom.c @@ -260,7 +260,7 @@ static void __encode_table_header_to_buf(struct ras_eeprom_table_header *hdr, unsigned char *buf) { - u32 *pp = (uint32_t *)buf; + __le32 *pp = (__le32 *)buf; pp[0] = cpu_to_le32(hdr->header); pp[1] = cpu_to_le32(hdr->version); @@ -273,7 +273,7 @@ static void __decode_table_header_from_buf(struct ras_eeprom_table_header *hdr, unsigned char *buf) { - u32 *pp = (uint32_t *)buf; + __le32 *pp = (__le32 *)buf; hdr->header = le32_to_cpu(pp[0]); hdr->version = le32_to_cpu(pp[1]); @@ -315,7 +315,7 @@ static void __encode_table_ras_info_to_buf(struct ras_eeprom_table_ras_info *rai, unsigned char *buf) { - u32 *pp = (uint32_t *)buf; + __le32 *pp = (__le32 *)buf; u32 tmp; tmp = ((uint32_t)(rai->rma_status) & 0xFF) |