Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] clk: fix devm_platform_ioremap_resource.cocci warnings
@ 2019-08-08 16:10 Julia Lawall
  2019-08-08 19:48 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2019-08-08 16:10 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-kernel, linux-arm-kernel, linux-clk,
	bcm-kernel-feedback-list, Michael Turquette,
	Philippe Mathieu-Daud??,
	Florian Fainelli, Stephen Boyd, linux-kernel, kbuild-all

From: kbuild test robot <lkp@intel.com>

drivers/clk/bcm/clk-bcm63xx-gate.c:174:1-9: WARNING: Use devm_platform_ioremap_resource for hw -> regs

 Use devm_platform_ioremap_resource helper which wraps
 platform_get_resource() and devm_ioremap_resource() together.

Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci

Fixes: 1c099779c1e2 ("clk: add BCM63XX gated clock controller driver")
CC: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ecb095bff5d4b8711a81968625b3b4a235d3e477
commit: 1c099779c1e2e8e0e10cdb2aecd4b35f428e9f00 clk: add BCM63XX gated clock controller driver
:::::: branch date: 15 hours ago
:::::: commit date: 6 weeks ago

 clk-bcm63xx-gate.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/clk/bcm/clk-bcm63xx-gate.c
+++ b/drivers/clk/bcm/clk-bcm63xx-gate.c
@@ -146,7 +146,6 @@ static int clk_bcm63xx_probe(struct plat
 {
 	const struct clk_bcm63xx_table_entry *entry, *table;
 	struct clk_bcm63xx_hw *hw;
-	struct resource *r;
 	u8 maxbit = 0;
 	int i, ret;

@@ -170,8 +169,7 @@ static int clk_bcm63xx_probe(struct plat
 	for (i = 0; i < maxbit; i++)
 		hw->data.hws[i] = ERR_PTR(-ENODEV);

-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hw->regs = devm_ioremap_resource(&pdev->dev, r);
+	hw->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hw->regs))
 		return PTR_ERR(hw->regs);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: fix devm_platform_ioremap_resource.cocci warnings
  2019-08-08 16:10 [PATCH] clk: fix devm_platform_ioremap_resource.cocci warnings Julia Lawall
@ 2019-08-08 19:48 ` Stephen Boyd
  2019-08-08 19:51   ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2019-08-08 19:48 UTC (permalink / raw)
  To: Jonas Gorski, Julia Lawall
  Cc: linux-kernel, linux-arm-kernel, linux-clk,
	bcm-kernel-feedback-list, Michael Turquette,
	Philippe Mathieu-Daud??,
	Florian Fainelli, linux-kernel, kbuild-all

Quoting Julia Lawall (2019-08-08 09:10:53)
> From: kbuild test robot <lkp@intel.com>
> 
> drivers/clk/bcm/clk-bcm63xx-gate.c:174:1-9: WARNING: Use devm_platform_ioremap_resource for hw -> regs
> 
>  Use devm_platform_ioremap_resource helper which wraps
>  platform_get_resource() and devm_ioremap_resource() together.
> 
> Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci
> 
> Fixes: 1c099779c1e2 ("clk: add BCM63XX gated clock controller driver")

Is it fixing anything? As far as I can tell it's reducing lines of code
with another function.

> CC: Jonas Gorski <jonas.gorski@gmail.com>
> Signed-off-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: fix devm_platform_ioremap_resource.cocci warnings
  2019-08-08 19:48 ` Stephen Boyd
@ 2019-08-08 19:51   ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2019-08-08 19:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Jonas Gorski, linux-kernel, linux-arm-kernel, linux-clk,
	bcm-kernel-feedback-list, Michael Turquette,
	Philippe Mathieu-Daud??,
	Florian Fainelli, linux-kernel, kbuild-all



On Thu, 8 Aug 2019, Stephen Boyd wrote:

> Quoting Julia Lawall (2019-08-08 09:10:53)
> > From: kbuild test robot <lkp@intel.com>
> >
> > drivers/clk/bcm/clk-bcm63xx-gate.c:174:1-9: WARNING: Use devm_platform_ioremap_resource for hw -> regs
> >
> >  Use devm_platform_ioremap_resource helper which wraps
> >  platform_get_resource() and devm_ioremap_resource() together.
> >
> > Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci
> >
> > Fixes: 1c099779c1e2 ("clk: add BCM63XX gated clock controller driver")
>
> Is it fixing anything? As far as I can tell it's reducing lines of code
> with another function.

No, it doesn't fix anything.

julia

>
> > CC: Jonas Gorski <jonas.gorski@gmail.com>
> > Signed-off-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 16:10 [PATCH] clk: fix devm_platform_ioremap_resource.cocci warnings Julia Lawall
2019-08-08 19:48 ` Stephen Boyd
2019-08-08 19:51   ` Julia Lawall

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org linux-clk@archiver.kernel.org
	public-inbox-index linux-clk


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/ public-inbox