diff mbox

[net-next,v2,4/4] net: phy: remove unneeded parenthesis

Message ID 1390508269-28769-5-git-send-email-f.fainelli@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Florian Fainelli Jan. 23, 2014, 8:17 p.m. UTC
Our if/else statement in phy_print_status() is only comprised of one
line for each, remove the parenthesis.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/phy.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Sergei Shtylyov Jan. 23, 2014, 10:37 p.m. UTC | #1
Hello.

On 24-01-2014 0:17, Florian Fainelli wrote:

> Our if/else statement in phy_print_status() is only comprised of one
> line for each, remove the parenthesis.

    I protest, the *if* arm is multi-line, though single statement. :-)
Could we avoid changing that code to and fro during 3.14-rc1?

> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   drivers/net/phy/phy.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)

> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 36fc6e1..59aa85e 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -64,15 +64,14 @@ static const char *phy_speed_to_str(int speed)
>    */
>   void phy_print_status(struct phy_device *phydev)
>   {
> -	if (phydev->link) {
> +	if (phydev->link)
>   		netdev_info(phydev->attached_dev,
>   			"Link is Up - %s/%s - flow control %s\n",
>   			phy_speed_to_str(phydev->speed),
>   			DUPLEX_FULL == phydev->duplex ? "Full" : "Half",
>   			phydev->pause ? "rx/tx" : "off");
> -	} else	{
> +	else
>   		netdev_info(phydev->attached_dev, "Link is Down\n");
> -	}
>   }
>   EXPORT_SYMBOL(phy_print_status);

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Florian Fainelli Jan. 23, 2014, 10:39 p.m. UTC | #2
2014/1/23 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
>
> On 24-01-2014 0:17, Florian Fainelli wrote:
>
>> Our if/else statement in phy_print_status() is only comprised of one
>> line for each, remove the parenthesis.
>
>
>    I protest, the *if* arm is multi-line, though single statement. :-)
> Could we avoid changing that code to and fro during 3.14-rc1?

Is it that big of a problem? Does that make checkpatch.pl unhappy,
does that make you unhappy? Since this is intentionally the last patch
in the series, it would be trivial for David to ignore it I suppose.

>
>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   drivers/net/phy/phy.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>
>
>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>> index 36fc6e1..59aa85e 100644
>> --- a/drivers/net/phy/phy.c
>> +++ b/drivers/net/phy/phy.c
>> @@ -64,15 +64,14 @@ static const char *phy_speed_to_str(int speed)
>>    */
>>   void phy_print_status(struct phy_device *phydev)
>>   {
>> -       if (phydev->link) {
>> +       if (phydev->link)
>>                 netdev_info(phydev->attached_dev,
>>                         "Link is Up - %s/%s - flow control %s\n",
>>                         phy_speed_to_str(phydev->speed),
>>                         DUPLEX_FULL == phydev->duplex ? "Full" : "Half",
>>                         phydev->pause ? "rx/tx" : "off");
>> -       } else  {
>> +       else
>>                 netdev_info(phydev->attached_dev, "Link is Down\n");
>> -       }
>>   }
>>   EXPORT_SYMBOL(phy_print_status);
>
>
> WBR, Sergei
>
Sergei Shtylyov Jan. 23, 2014, 10:59 p.m. UTC | #3
Hello.

On 24-01-2014 2:39, Florian Fainelli wrote:

>>> Our if/else statement in phy_print_status() is only comprised of one
>>> line for each, remove the parenthesis.

>>     I protest, the *if* arm is multi-line, though single statement. :-)
>> Could we avoid changing that code to and fro during 3.14-rc1?

> Is it that big of a problem?

    You should be clearer in the changelog, at least. :-)

> Does that make checkpatch.pl unhappy,

    No, it doesn't.

> does that make you unhappy?

    Kind of, as it was me who added {} in net-next, IIRC.

> Since this is intentionally the last patch
> in the series, it would be trivial for David to ignore it I suppose.

    Would be fine...

>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>> ---
>>>    drivers/net/phy/phy.c | 5 ++---
>>>    1 file changed, 2 insertions(+), 3 deletions(-)

>>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>>> index 36fc6e1..59aa85e 100644
>>> --- a/drivers/net/phy/phy.c
>>> +++ b/drivers/net/phy/phy.c
>>> @@ -64,15 +64,14 @@ static const char *phy_speed_to_str(int speed)
>>>     */
>>>    void phy_print_status(struct phy_device *phydev)
>>>    {
>>> -       if (phydev->link) {
>>> +       if (phydev->link)
>>>                  netdev_info(phydev->attached_dev,
>>>                          "Link is Up - %s/%s - flow control %s\n",
>>>                          phy_speed_to_str(phydev->speed),
>>>                          DUPLEX_FULL == phydev->duplex ? "Full" : "Half",
>>>                          phydev->pause ? "rx/tx" : "off");
>>> -       } else  {
>>> +       else
>>>                  netdev_info(phydev->attached_dev, "Link is Down\n");
>>> -       }
>>>    }
>>>    EXPORT_SYMBOL(phy_print_status);

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Fabio Estevam Jan. 23, 2014, 11:39 p.m. UTC | #4
On Thu, Jan 23, 2014 at 6:17 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> Our if/else statement in phy_print_status() is only comprised of one
> line for each, remove the parenthesis.

Your patch removes the braces, not the parenthesis ;-)

Regards,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 36fc6e1..59aa85e 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -64,15 +64,14 @@  static const char *phy_speed_to_str(int speed)
  */
 void phy_print_status(struct phy_device *phydev)
 {
-	if (phydev->link) {
+	if (phydev->link)
 		netdev_info(phydev->attached_dev,
 			"Link is Up - %s/%s - flow control %s\n",
 			phy_speed_to_str(phydev->speed),
 			DUPLEX_FULL == phydev->duplex ? "Full" : "Half",
 			phydev->pause ? "rx/tx" : "off");
-	} else	{
+	else
 		netdev_info(phydev->attached_dev, "Link is Down\n");
-	}
 }
 EXPORT_SYMBOL(phy_print_status);