* [PATCH] iommu: sprd: Fix parameter type warning
@ 2021-03-31 3:16 Chunyan Zhang
2021-04-07 8:44 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Chunyan Zhang @ 2021-03-31 3:16 UTC (permalink / raw)
To: Joerg Roedel; +Cc: Chunyan Zhang, iommu, linux-kernel, Chunyan Zhang
From: Chunyan Zhang <chunyan.zhang@unisoc.com>
The second parameter of clk_get_optional() is "const char *", so use NULL
instead of integer 0 to fix a sparse warning like:
">> drivers/iommu/sprd-iommu.c:456:42: sparse: sparse: Using plain integer as NULL pointer"
Also this patch changes to use the resource-managed variant of
clk_get_optional(), then there's no need to add clk_put() which
is missed in the current driver.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
drivers/iommu/sprd-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c
index 7100ed17dcce..371d5715cbc9 100644
--- a/drivers/iommu/sprd-iommu.c
+++ b/drivers/iommu/sprd-iommu.c
@@ -453,7 +453,7 @@ static int sprd_iommu_clk_enable(struct sprd_iommu_device *sdev)
{
struct clk *eb;
- eb = clk_get_optional(sdev->dev, 0);
+ eb = devm_clk_get_optional(sdev->dev, NULL);
if (!eb)
return 0;
--
2.25.1
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iommu: sprd: Fix parameter type warning
2021-03-31 3:16 [PATCH] iommu: sprd: Fix parameter type warning Chunyan Zhang
@ 2021-04-07 8:44 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2021-04-07 8:44 UTC (permalink / raw)
To: Chunyan Zhang; +Cc: iommu, linux-kernel, Chunyan Zhang
On Wed, Mar 31, 2021 at 11:16:45AM +0800, Chunyan Zhang wrote:
> drivers/iommu/sprd-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-07 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 3:16 [PATCH] iommu: sprd: Fix parameter type warning Chunyan Zhang
2021-04-07 8:44 ` Joerg Roedel
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).