From: Geert Uytterhoeven <geert@linux-m68k.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"Grygorii Strashko" <grygorii.strashko@ti.com>,
ivan.khoronzhuk@linaro.org, "Andrew Lunn" <andrew@lunn.ch>,
"Petr Štetiar" <ynezz@true.cz>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"open list:TI ETHERNET SWITCH DRIVER (CPSW)"
<linux-omap@vger.kernel.org>
Subject: Re: [PATCH net-next] net: ethernet: ti: use devm_platform_ioremap_resource() to simplify code
Date: Tue, 17 Sep 2019 20:35:51 +0200 [thread overview]
Message-ID: <CAMuHMdXdd4oiHqTpFTYBTSeCB6A78_gSGmwPy5EgPRZXibOqZw@mail.gmail.com> (raw)
In-Reply-To: <20190821124850.9592-1-yuehaibing@huawei.com>
Hi YueHaibing,
On Wed, Aug 21, 2019 at 2:51 PM YueHaibing <yuehaibing@huawei.com> wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/ethernet/ti/cpsw.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 32a8974..5401095 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -2764,7 +2764,7 @@ static int cpsw_probe(struct platform_device *pdev)
> struct net_device *ndev;
> struct cpsw_priv *priv;
> void __iomem *ss_regs;
> - struct resource *res, *ss_res;
> + struct resource *ss_res;
> struct gpio_descs *mode;
> const struct soc_device_attribute *soc;
> struct cpsw_common *cpsw;
> @@ -2798,8 +2798,7 @@ static int cpsw_probe(struct platform_device *pdev)
And just out-of-context, we also have:
ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ss_regs = devm_ioremap_resource(dev, ss_res);
if (IS_ERR(ss_regs))
which was not detected as being the same pattern?
Interesting...
> return PTR_ERR(ss_regs);
> cpsw->regs = ss_regs;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - cpsw->wr_regs = devm_ioremap_resource(dev, res);
> + cpsw->wr_regs = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(cpsw->wr_regs))
> return PTR_ERR(cpsw->wr_regs);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2019-09-17 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 12:48 [PATCH net-next] net: ethernet: ti: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-08-21 14:20 ` Grygorii Strashko
2019-08-21 20:42 ` David Miller
2019-09-17 18:35 ` Geert Uytterhoeven [this message]
2019-09-18 9:29 ` Grygorii Strashko
2019-09-18 9:35 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMuHMdXdd4oiHqTpFTYBTSeCB6A78_gSGmwPy5EgPRZXibOqZw@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=ivan.khoronzhuk@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ynezz@true.cz \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).