[PATCH] scsi: hisi_sas: Fix warning detected by sparse

Yihang Li posted 1 patch 3 months, 3 weeks ago
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] scsi: hisi_sas: Fix warning detected by sparse
Posted by Yihang Li 3 months, 3 weeks ago
LKP reports below warning when building for RISC-V with randconfig
configuration.

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4554:25: sparse:
sparse: incorrect type in argument 4 (different base types)
@@     expected restricted __le32 [usertype] *[assigned] ptr
@@     got unsigned int * @@

Type cast to fix this warning.

Fixes: 4ca7fe99fc84 ("scsi: hisi_sas: Use macro instead of magic number")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505150705.k9ZzMxf1-lkp@intel.com/
Signed-off-by: Yihang Li <liyihang9@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index d7f45a2eb200..bc5d5356dd00 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -4558,7 +4558,7 @@ static int debugfs_fifo_data_v3_hw_show(struct seq_file *s, void *p)
 
 	debugfs_show_row_32_v3_hw(s, 0,
 			HISI_SAS_FIFO_DATA_DW_SIZE * HISI_SAS_REG_MEM_SIZE,
-			phy->fifo.rd_data);
+			(__le32 *)phy->fifo.rd_data);
 
 	return 0;
 }
-- 
2.33.0
Re: [PATCH] scsi: hisi_sas: Fix warning detected by sparse
Posted by Martin K. Petersen 3 months, 2 weeks ago
On Thu, 15 May 2025 09:35:04 +0800, Yihang Li wrote:

> LKP reports below warning when building for RISC-V with randconfig
> configuration.
> 
> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4554:25: sparse:
> sparse: incorrect type in argument 4 (different base types)
> @@     expected restricted __le32 [usertype] *[assigned] ptr
> @@     got unsigned int * @@
> 
> [...]

Applied to 6.16/scsi-queue, thanks!

[1/1] scsi: hisi_sas: Fix warning detected by sparse
      https://git.kernel.org/mkp/scsi/c/0c52f621f5be

-- 
Martin K. Petersen	Oracle Linux Engineering
Re: [PATCH] scsi: hisi_sas: Fix warning detected by sparse
Posted by Martin K. Petersen 3 months, 3 weeks ago
Yihang,

> LKP reports below warning when building for RISC-V with randconfig
> configuration.

Applied to 6.16/scsi-staging, thanks!

-- 
Martin K. Petersen