netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: improve genphy_read_status
Date: Sun, 31 Mar 2019 16:59:13 +0200	[thread overview]
Message-ID: <c9289f2c-5546-41f8-dd49-464b0e45bfb4@gmail.com> (raw)
In-Reply-To: <20190331145241.GC20636@lunn.ch>

On 31.03.2019 16:52, Andrew Lunn wrote:
>> -	if (AUTONEG_ENABLE == phydev->autoneg) {
>> +	if (phydev->autoneg == AUTONEG_ENABLE && phydev->link) {
> 
> Hi Heiner
> 
> I don't necessary agree with placing the constant first in the
> comparison, but it is best practice not to change it when making
> additions. It makes it a little bit harder to see what the actual
> change was.
> 
I understand the point. However a patch to only change the order
of the operands most likely would also be rejected as not being
worth it. As a consequence we would have to live with it forever.
So I think it needs some "if we touch the code anyway" situation.
Or what would be the preferred way to change something like that
that is in general ok and can be just a little bit improved?

>        Andrew
> 
Heiner

  reply	other threads:[~2019-03-31 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30  9:22 [PATCH net-next] net: phy: improve genphy_read_status Heiner Kallweit
2019-03-31 14:52 ` Andrew Lunn
2019-03-31 14:59   ` Heiner Kallweit [this message]
2019-03-31 15:33     ` Andrew Lunn
2019-03-31 14:58 ` Andrew Lunn
2019-03-31 15:05   ` Heiner Kallweit
2019-04-02 17:39     ` Heiner Kallweit
2019-04-02  1:07 ` David Miller

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=c9289f2c-5546-41f8-dd49-464b0e45bfb4@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).