* [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning
[not found] <CGME20210819170304epcas5p211ae01fc6ba6f5beaf7afaa90dcd5dda@epcas5p2.samsung.com>
@ 2021-08-19 17:11 ` Alim Akhtar
2021-08-24 3:15 ` Martin K. Petersen
2021-08-28 2:31 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Alim Akhtar @ 2021-08-19 17:11 UTC (permalink / raw)
To: linux-scsi, martin.petersen
Cc: krzysztof.kozlowski, linux-samsung-soc, avri.altman, kwmad.kim,
dan.carpenter, Alim Akhtar
clk_get_rate() returns unsigned long and currently this driver
stores the return value in u32 type, resulting the below warning:
Fixed smatch warnings:
drivers/scsi/ufs/ufs-exynos.c:286 exynos_ufs_get_clk_info()
warn: wrong type for 'ufs->mclk_rate' (should be 'ulong')
drivers/scsi/ufs/ufs-exynos.c:287 exynos_ufs_get_clk_info()
warn: wrong type for 'pclk_rate' (should be 'ulong')
Fixes: 55f4b1f73631: "scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
---
drivers/scsi/ufs/ufs-exynos.c | 4 ++--
drivers/scsi/ufs/ufs-exynos.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index cf46d6f86e0e..427a2ff7e9da 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -260,7 +260,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)
struct ufs_hba *hba = ufs->hba;
struct list_head *head = &hba->clk_list_head;
struct ufs_clk_info *clki;
- u32 pclk_rate;
+ unsigned long pclk_rate;
u32 f_min, f_max;
u8 div = 0;
int ret = 0;
@@ -299,7 +299,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)
}
if (unlikely(pclk_rate < f_min || pclk_rate > f_max)) {
- dev_err(hba->dev, "not available pclk range %d\n", pclk_rate);
+ dev_err(hba->dev, "not available pclk range %lu\n", pclk_rate);
ret = -EINVAL;
goto out;
}
diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h
index 67505fe32ebf..dadf4fd10dd8 100644
--- a/drivers/scsi/ufs/ufs-exynos.h
+++ b/drivers/scsi/ufs/ufs-exynos.h
@@ -184,7 +184,7 @@ struct exynos_ufs {
u32 pclk_div;
u32 pclk_avail_min;
u32 pclk_avail_max;
- u32 mclk_rate;
+ unsigned long mclk_rate;
int avail_ln_rx;
int avail_ln_tx;
int rx_sel_idx;
base-commit: 36a21d51725af2ce0700c6ebcb6b9594aac658a6
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning
2021-08-19 17:11 ` [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning Alim Akhtar
@ 2021-08-24 3:15 ` Martin K. Petersen
2021-08-28 2:31 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-24 3:15 UTC (permalink / raw)
To: Alim Akhtar
Cc: linux-scsi, martin.petersen, krzysztof.kozlowski,
linux-samsung-soc, avri.altman, kwmad.kim, dan.carpenter
Alim,
> clk_get_rate() returns unsigned long and currently this driver
> stores the return value in u32 type, resulting the below warning:
Applied to 5.15/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning
2021-08-19 17:11 ` [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning Alim Akhtar
2021-08-24 3:15 ` Martin K. Petersen
@ 2021-08-28 2:31 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-28 2:31 UTC (permalink / raw)
To: Alim Akhtar, linux-scsi
Cc: Martin K . Petersen, dan.carpenter, krzysztof.kozlowski,
kwmad.kim, avri.altman, linux-samsung-soc
On Thu, 19 Aug 2021 22:41:31 +0530, Alim Akhtar wrote:
> clk_get_rate() returns unsigned long and currently this driver
> stores the return value in u32 type, resulting the below warning:
>
> Fixed smatch warnings:
>
> drivers/scsi/ufs/ufs-exynos.c:286 exynos_ufs_get_clk_info()
> warn: wrong type for 'ufs->mclk_rate' (should be 'ulong')
>
> [...]
Applied to 5.15/scsi-queue, thanks!
[1/1] scsi: ufs: ufs-exynos: Fix static checker warning
https://git.kernel.org/mkp/scsi/c/313bf281f209
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-28 2:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20210819170304epcas5p211ae01fc6ba6f5beaf7afaa90dcd5dda@epcas5p2.samsung.com>
2021-08-19 17:11 ` [PATCH] scsi: ufs: ufs-exynos: Fix static checker warning Alim Akhtar
2021-08-24 3:15 ` Martin K. Petersen
2021-08-28 2:31 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).