All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ethtool: fixed trailing statements in ethtool
@ 2013-07-13 13:43 Dragos Foianu
  2013-07-15 13:54 ` Ben Hutchings
  2013-07-16 19:15 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dragos Foianu @ 2013-07-13 13:43 UTC (permalink / raw)
  To: davem
  Cc: ben, pshelar, mschmidt, ebiederm, netdev, linux-kernel, Dragos Foianu

Applied fixes suggested by checkpatch.pl.

Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>
---
 net/core/ethtool.c |   30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index ab5fa63..78e9d92 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -279,11 +279,16 @@ static u32 __ethtool_get_flags(struct net_device *dev)
 {
 	u32 flags = 0;
 
-	if (dev->features & NETIF_F_LRO)	     flags |= ETH_FLAG_LRO;
-	if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) flags |= ETH_FLAG_RXVLAN;
-	if (dev->features & NETIF_F_HW_VLAN_CTAG_TX) flags |= ETH_FLAG_TXVLAN;
-	if (dev->features & NETIF_F_NTUPLE)	     flags |= ETH_FLAG_NTUPLE;
-	if (dev->features & NETIF_F_RXHASH)	     flags |= ETH_FLAG_RXHASH;
+	if (dev->features & NETIF_F_LRO)
+		flags |= ETH_FLAG_LRO;
+	if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
+		flags |= ETH_FLAG_RXVLAN;
+	if (dev->features & NETIF_F_HW_VLAN_CTAG_TX)
+		flags |= ETH_FLAG_TXVLAN;
+	if (dev->features & NETIF_F_NTUPLE)
+		flags |= ETH_FLAG_NTUPLE;
+	if (dev->features & NETIF_F_RXHASH)
+		flags |= ETH_FLAG_RXHASH;
 
 	return flags;
 }
@@ -295,11 +300,16 @@ static int __ethtool_set_flags(struct net_device *dev, u32 data)
 	if (data & ~ETH_ALL_FLAGS)
 		return -EINVAL;
 
-	if (data & ETH_FLAG_LRO)	features |= NETIF_F_LRO;
-	if (data & ETH_FLAG_RXVLAN)	features |= NETIF_F_HW_VLAN_CTAG_RX;
-	if (data & ETH_FLAG_TXVLAN)	features |= NETIF_F_HW_VLAN_CTAG_TX;
-	if (data & ETH_FLAG_NTUPLE)	features |= NETIF_F_NTUPLE;
-	if (data & ETH_FLAG_RXHASH)	features |= NETIF_F_RXHASH;
+	if (data & ETH_FLAG_LRO)
+		features |= NETIF_F_LRO;
+	if (data & ETH_FLAG_RXVLAN)
+		features |= NETIF_F_HW_VLAN_CTAG_RX;
+	if (data & ETH_FLAG_TXVLAN)
+		features |= NETIF_F_HW_VLAN_CTAG_TX;
+	if (data & ETH_FLAG_NTUPLE)
+		features |= NETIF_F_NTUPLE;
+	if (data & ETH_FLAG_RXHASH)
+		features |= NETIF_F_RXHASH;
 
 	/* allow changing only bits set in hw_features */
 	changed = (features ^ dev->features) & ETH_ALL_FEATURES;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ethtool: fixed trailing statements in ethtool
  2013-07-13 13:43 [PATCH] ethtool: fixed trailing statements in ethtool Dragos Foianu
@ 2013-07-15 13:54 ` Ben Hutchings
  2013-07-16 19:15 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2013-07-15 13:54 UTC (permalink / raw)
  To: Dragos Foianu
  Cc: davem, ben, pshelar, mschmidt, ebiederm, netdev, linux-kernel

On Sat, 2013-07-13 at 14:43 +0100, Dragos Foianu wrote:
> Applied fixes suggested by checkpatch.pl.
> 
> Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>

I think that it's fine to put the conditional statement on the same line
for repetitive conversion code like this.  I don't think anyone's likely
to mis-read it, which I think is the reason why checkpatch warns.

But I also won't object to this.  I don't mind either way.

Ben.

> ---
>  net/core/ethtool.c |   30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index ab5fa63..78e9d92 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -279,11 +279,16 @@ static u32 __ethtool_get_flags(struct net_device *dev)
>  {
>  	u32 flags = 0;
>  
> -	if (dev->features & NETIF_F_LRO)	     flags |= ETH_FLAG_LRO;
> -	if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) flags |= ETH_FLAG_RXVLAN;
> -	if (dev->features & NETIF_F_HW_VLAN_CTAG_TX) flags |= ETH_FLAG_TXVLAN;
> -	if (dev->features & NETIF_F_NTUPLE)	     flags |= ETH_FLAG_NTUPLE;
> -	if (dev->features & NETIF_F_RXHASH)	     flags |= ETH_FLAG_RXHASH;
> +	if (dev->features & NETIF_F_LRO)
> +		flags |= ETH_FLAG_LRO;
> +	if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
> +		flags |= ETH_FLAG_RXVLAN;
> +	if (dev->features & NETIF_F_HW_VLAN_CTAG_TX)
> +		flags |= ETH_FLAG_TXVLAN;
> +	if (dev->features & NETIF_F_NTUPLE)
> +		flags |= ETH_FLAG_NTUPLE;
> +	if (dev->features & NETIF_F_RXHASH)
> +		flags |= ETH_FLAG_RXHASH;
>  
>  	return flags;
>  }
> @@ -295,11 +300,16 @@ static int __ethtool_set_flags(struct net_device *dev, u32 data)
>  	if (data & ~ETH_ALL_FLAGS)
>  		return -EINVAL;
>  
> -	if (data & ETH_FLAG_LRO)	features |= NETIF_F_LRO;
> -	if (data & ETH_FLAG_RXVLAN)	features |= NETIF_F_HW_VLAN_CTAG_RX;
> -	if (data & ETH_FLAG_TXVLAN)	features |= NETIF_F_HW_VLAN_CTAG_TX;
> -	if (data & ETH_FLAG_NTUPLE)	features |= NETIF_F_NTUPLE;
> -	if (data & ETH_FLAG_RXHASH)	features |= NETIF_F_RXHASH;
> +	if (data & ETH_FLAG_LRO)
> +		features |= NETIF_F_LRO;
> +	if (data & ETH_FLAG_RXVLAN)
> +		features |= NETIF_F_HW_VLAN_CTAG_RX;
> +	if (data & ETH_FLAG_TXVLAN)
> +		features |= NETIF_F_HW_VLAN_CTAG_TX;
> +	if (data & ETH_FLAG_NTUPLE)
> +		features |= NETIF_F_NTUPLE;
> +	if (data & ETH_FLAG_RXHASH)
> +		features |= NETIF_F_RXHASH;
>  
>  	/* allow changing only bits set in hw_features */
>  	changed = (features ^ dev->features) & ETH_ALL_FEATURES;

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ethtool: fixed trailing statements in ethtool
  2013-07-13 13:43 [PATCH] ethtool: fixed trailing statements in ethtool Dragos Foianu
  2013-07-15 13:54 ` Ben Hutchings
@ 2013-07-16 19:15 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-07-16 19:15 UTC (permalink / raw)
  To: dragos.foianu; +Cc: ben, pshelar, mschmidt, ebiederm, netdev, linux-kernel

From: Dragos Foianu <dragos.foianu@gmail.com>
Date: Sat, 13 Jul 2013 14:43:00 +0100

> Applied fixes suggested by checkpatch.pl.
> 
> Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>

Applied, but only so that life is easier for the next person who
makes changes to this file and wants to validate things with
checkpatch.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-16 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-13 13:43 [PATCH] ethtool: fixed trailing statements in ethtool Dragos Foianu
2013-07-15 13:54 ` Ben Hutchings
2013-07-16 19:15 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.