From: Dan Murphy <dmurphy@ti•com>
To: Florian Fainelli <f.fainelli@gmail•com>,
David Binderman <dcb314@hotmail•com>,
"netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: Re: drivers/net/phy/dp83867.c:167: possible bad if ?
Date: Mon, 20 Jul 2015 12:52:02 -0500 [thread overview]
Message-ID: <55AD3542.7080906@ti.com> (raw)
In-Reply-To: <55AD328A.9040106@gmail.com>
On 07/20/2015 12:40 PM, Florian Fainelli wrote:
> On 20/07/15 10:37, Dan Murphy wrote:
>> Florian
>>
>> On 07/20/2015 12:28 PM, Florian Fainelli wrote:
>>> Adding Dan,
>>>
>>> On 20/07/15 05:37, David Binderman wrote:
>>>> Hello there,
>>>>
>>>> drivers/net/phy/dp83867.c:167:57: warning: logical ‘or’ of collectively exhaustive tests is always true [-Wlogical-op]
>>>>
>>>> Source code is
>>>>
>>>> if ((phydev->interface>= PHY_INTERFACE_MODE_RGMII_ID) ||
>>>> (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
>>>>
>>>> Maybe
>>>>
>>>> if ((phydev->interface>= PHY_INTERFACE_MODE_RGMII_ID) &&
>>>> (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
>>> Sounds like the former is the intended comparison that will make sure
>>> that phydev->interface is between MODE_RGMII_ID and MODE_RGMII_RXID, and
>>> not below or after.
>> That is correct. The internal delay only needs to be set if this is declared
>> via the DT. There can be one of 3 interface internal delay (RGMII_ID), RX internal delay (RGMII_RX_ID) or TX
>> internal delay (RGMII_TX_ID).
> Sorry, I meant to write the latter instead of the former here, the
> current code seems to be potentially too permissive, is not it? In that
> case, it seems to me like David's proposed fix is relevant.
The proposed fix is logically correct. And it matches the code for
phy_interface_is_rgmii with the '&&'.
Did you want me to patch and test?
Dan
>
>> This internal delay is only applicable for RGMII and can be made specific to the
>> board.
>>
>> The driver only needs to set the delay per the declaration in the DT.
>>
>> Dan
>>
>
--
------------------
Dan Murphy
next prev parent reply other threads:[~2015-07-20 17:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 12:37 drivers/net/phy/dp83867.c:167: possible bad if ? David Binderman
2015-07-20 17:28 ` Florian Fainelli
2015-07-20 17:37 ` Dan Murphy
2015-07-20 17:40 ` Florian Fainelli
2015-07-20 17:52 ` Dan Murphy [this message]
2015-07-20 18:00 ` David Binderman
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=55AD3542.7080906@ti.com \
--to=dmurphy@ti$(echo .)com \
--cc=dcb314@hotmail$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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