linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	Hans Ulli Kroll <ulli.kroll@googlemail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next v2] net: gemini: Use devm_platform_get_and_ioremap_resource()
Date: Mon, 7 Jun 2021 08:49:58 +0200	[thread overview]
Message-ID: <CACRpkdZ+sT=YMZbvYmArZB50CPObsKe3CiBW=KysVubPt1-+_A@mail.gmail.com> (raw)
In-Reply-To: <da671768-64b8-e658-20bb-c536df8c1aae@huawei.com>

On Mon, Jun 7, 2021 at 3:05 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
> On 2021/6/5 23:17, Linus Walleij wrote:
> > On Sat, Jun 5, 2021 at 2:32 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
> >
> >> Use devm_platform_get_and_ioremap_resource() to simplify
> >> code.
> >>
> >> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> > (...)
> >> -       dmares = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >> -       gmacres = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > Should you not also delete the local variables
> > dmares and gmacres? I doubt they are used
> > after this.
>
> They are used to print message before returning gemini_ethernet_port_probe()
> static int gemini_ethernet_port_probe(struct platform_device *pdev)

Yes and after this they will print something undefined since you never
assign them anything, so the dmares and gmacres prints need to be
removed too. (Which is fine.)

Yours,
Linus Walleij

      reply	other threads:[~2021-06-07  6:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 12:36 [PATCH net-next v2] net: gemini: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
2021-06-05 15:17 ` Linus Walleij
2021-06-07  1:05   ` Yang Yingliang
2021-06-07  6:49     ` Linus Walleij [this message]

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='CACRpkdZ+sT=YMZbvYmArZB50CPObsKe3CiBW=KysVubPt1-+_A@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ulli.kroll@googlemail.com \
    --cc=yangyingliang@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).