From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>
Subject: Re: [PATCH v2 net] net: phy: aquantia: wait for the suspend/resume operations to finish
Date: Tue, 6 Sep 2022 14:09:35 +0000 [thread overview]
Message-ID: <20220906140934.vtxddfvtdlom563l@skbuf> (raw)
In-Reply-To: <YxdG6r0pF7NSW+EJ@lunn.ch>
On Tue, Sep 06, 2022 at 03:11:06PM +0200, Andrew Lunn wrote:
> > +static int aqr107_wait_processor_intensive_op(struct phy_device *phydev)
> > +{
> > + int val, err;
> > +
> > + /* The datasheet notes to wait at least 1ms after issuing a
> > + * processor intensive operation before checking.
> > + * We cannot use the 'sleep_before_read' parameter of read_poll_timeout
> > + * because that just determines the maximum time slept, not the minimum.
> > + */
> > + usleep_range(1000, 5000);
> > +
> > + err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
> > + VEND1_GLOBAL_GEN_STAT2, val,
> > + !(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG),
> > + AQR107_OP_IN_PROG_SLEEP,
> > + AQR107_OP_IN_PROG_TIMEOUT, false);
> > + if (err) {
> > + phydev_err(phydev, "timeout: processor-intensive MDIO operation\n");
> > + return err;
> > + }
> > +
> > + return 0;
>
> nitpick: You could simplify this to:
>
> > + if (err)
> > + phydev_err(phydev, "timeout: processor-intensive MDIO operation\n");
> > +
> > + return err;
> > +}
>
I would prefer to leave it as it is. I know that in this particular case
we could spare the braces but in general I am not so keen of this form
since if there is more to add to the function, it would force us to also
re-add the return statement.
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
Thanks,
Ioana
next prev parent reply other threads:[~2022-09-06 14:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 13:04 [PATCH v2 net] net: phy: aquantia: wait for the suspend/resume operations to finish Ioana Ciornei
2022-09-06 13:11 ` Andrew Lunn
2022-09-06 14:09 ` Ioana Ciornei [this message]
2022-09-13 8:10 ` patchwork-bot+netdevbpf
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=20220906140934.vtxddfvtdlom563l@skbuf \
--to=ioana.ciornei@nxp.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).