From: David Miller <davem@davemloft.net>
To: joe@perches.com
Cc: plyatov@gmail.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, f.fainelli@gmail.com,
luwei.zhou@freescale.com, richardcochran@gmail.com,
u.kleine-koenig@pengutronix.de, Fabio.Estevam@freescale.com,
LW@KARO-electronics.de, Frank.Li@freescale.com
Subject: Re: [PATCH] net: phy: workaround for buggy cable detection by LAN8700 after cable plugging
Date: Thu, 13 Aug 2015 11:37:43 -0700 (PDT) [thread overview]
Message-ID: <20150813.113743.802151188971802087.davem@davemloft.net> (raw)
In-Reply-To: <1439486115.27506.1.camel@perches.com>
From: Joe Perches <joe@perches.com>
Date: Thu, 13 Aug 2015 10:15:15 -0700
> On Thu, 2015-08-13 at 20:11 +0300, Igor Plyatov wrote:
>> > On Thu, 2015-08-13 at 16:12 +0300, Igor Plyatov wrote:
>> >> * Due to HW bug, LAN8700 sometimes does not detect presence of energy in the
>> >> Ethernet cable in Energy Detect Power-Down mode (e.g while EDPWRDOWN bit is
>> >> set, the ENERGYON bit does not asserted sometimes). This is a common bug of
>> >> LAN87xx family of PHY chips.
>> >> * The lan87xx_read_status() was improved to acquire ENERGYON bit. Its previous
>> >> algorythm still not reliable on 100 % and sometimes skip cable plugging.
>> > []
>> >> diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
>> > []
>> >> @@ -104,10 +104,12 @@ static int lan911x_config_init(struct phy_device *phydev)
>> >> static int lan87xx_read_status(struct phy_device *phydev)
>> >> {
>> >> int err = genphy_read_status(phydev);
>> >> + int rc;
>> > Is there a reason to move this declaration?
>>
>> There is no strict requirement to move declaration of the rc.
>> It was made just to have all declarations easily visible.
>
> Generally it's better to have declarations
> in the minimal/narrowest scope possible.
Agreed, and it's %100 unrelated to the purpose of this patch so not
should be included for that reason as well.
You will need to respin this patch with the variable moving elided.
next prev parent reply other threads:[~2015-08-13 18:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 13:12 [PATCH] net: phy: workaround for buggy cable detection by LAN8700 after cable plugging Igor Plyatov
2015-08-13 16:50 ` Joe Perches
2015-08-13 17:11 ` Igor Plyatov
2015-08-13 17:15 ` Joe Perches
2015-08-13 18:37 ` David Miller [this message]
2015-08-13 19:23 ` Igor Plyatov
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=20150813.113743.802151188971802087.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Fabio.Estevam@freescale.com \
--cc=Frank.Li@freescale.com \
--cc=LW@KARO-electronics.de \
--cc=f.fainelli@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luwei.zhou@freescale.com \
--cc=netdev@vger.kernel.org \
--cc=plyatov@gmail.com \
--cc=richardcochran@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).