2023-07-26 05:51:11

by Sunil V L

[permalink] [raw]
Subject: [PATCH] scsi: hisi_sas: Fix warning detected by sparse

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

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4567:35: 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.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Sunil V L <[email protected]>
---
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 20e1607c6282..6cd2e485d35b 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -4576,7 +4576,7 @@ static int debugfs_fifo_data_v3_hw_show(struct seq_file *s, void *p)
debugfs_read_fifo_data_v3_hw(phy);

debugfs_show_row_32_v3_hw(s, 0, HISI_SAS_FIFO_DATA_DW_SIZE * 4,
- phy->fifo.rd_data);
+ (__le32 *)phy->fifo.rd_data);

return 0;
}
--
2.34.1



2023-07-27 01:33:28

by chenxiang (M)

[permalink] [raw]
Subject: Re: [PATCH] scsi: hisi_sas: Fix warning detected by sparse

Hi Sunil,


?? 2023/7/26 ?????? 13:17, Sunil V L ะด??:
> LKP reports below warning when building for RISC-V
> with randconfig configuration.
>
> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4567:35: 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.
>
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Signed-off-by: Sunil V L <[email protected]>

Reviewed-by: Xiang Chen <[email protected]>

Thanks!

> ---
> 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 20e1607c6282..6cd2e485d35b 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
> @@ -4576,7 +4576,7 @@ static int debugfs_fifo_data_v3_hw_show(struct seq_file *s, void *p)
> debugfs_read_fifo_data_v3_hw(phy);
>
> debugfs_show_row_32_v3_hw(s, 0, HISI_SAS_FIFO_DATA_DW_SIZE * 4,
> - phy->fifo.rd_data);
> + (__le32 *)phy->fifo.rd_data);
>
> return 0;
> }


2023-07-31 19:28:30

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: hisi_sas: Fix warning detected by sparse


Sunil,

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

Applied to 6.6/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2023-08-08 15:41:27

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: hisi_sas: Fix warning detected by sparse

On Wed, 26 Jul 2023 10:47:59 +0530, Sunil V L wrote:

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

Applied to 6.6/scsi-queue, thanks!

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

--
Martin K. Petersen Oracle Linux Engineering