netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checkpatch run on net/ethernet
@ 2012-10-02 11:41 matthew
  2012-10-02 11:41 ` [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch) matthew
  2012-10-02 11:41 ` [PATCH 2/2] net: ethernet: Remove obsolete comment matthew
  0 siblings, 2 replies; 5+ messages in thread
From: matthew @ 2012-10-02 11:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, davem


This is my first patch, it's just a checkpatch run. I figured I would also clean up the code as there appears to be long-since-obsoleted comments and code in there.

A fairly trivial change, but worthy of inclusion IMO all the same!

Matthew Walster

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

* [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch)
  2012-10-02 11:41 checkpatch run on net/ethernet matthew
@ 2012-10-02 11:41 ` matthew
  2012-10-02 18:46   ` David Miller
  2012-10-02 11:41 ` [PATCH 2/2] net: ethernet: Remove obsolete comment matthew
  1 sibling, 1 reply; 5+ messages in thread
From: matthew @ 2012-10-02 11:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, davem, Matthew Walster

From: Matthew Walster <matthew@walster.org>

Remove an old commented out piece of code.
Remove an if(true) statement.
Remove a set of braces that weren't strictly necessary.

All found by running checkpatch.pl against the code.

Signed-off-by: Matthew Walster <matthew@walster.org>
---
 net/ethernet/eth.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 4efad53..a9f8531 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -178,11 +178,8 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	 *      seems to set IFF_PROMISC.
 	 */
 
-	else if (1 /*dev->flags&IFF_PROMISC */ ) {
-		if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
-						      dev->dev_addr)))
-			skb->pkt_type = PACKET_OTHERHOST;
-	}
+	else if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr)))
+		skb->pkt_type = PACKET_OTHERHOST;
 
 	/*
 	 * Some variants of DSA tagging don't have an ethertype field
-- 
1.7.10.4

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

* [PATCH 2/2] net: ethernet: Remove obsolete comment
  2012-10-02 11:41 checkpatch run on net/ethernet matthew
  2012-10-02 11:41 ` [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch) matthew
@ 2012-10-02 11:41 ` matthew
  2012-10-02 18:46   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: matthew @ 2012-10-02 11:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, davem, Matthew Walster

From: Matthew Walster <matthew@walster.org>

The deleted comment was related to code I've just removed in the previous patch.
---
 net/ethernet/eth.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a9f8531..7d72108 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -170,14 +170,6 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 			skb->pkt_type = PACKET_MULTICAST;
 	}
 
-	/*
-	 *      This ALLMULTI check should be redundant by 1.4
-	 *      so don't forget to remove it.
-	 *
-	 *      Seems, you forgot to remove it. All silly devices
-	 *      seems to set IFF_PROMISC.
-	 */
-
 	else if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr)))
 		skb->pkt_type = PACKET_OTHERHOST;
 
-- 
1.7.10.4

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

* Re: [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch)
  2012-10-02 11:41 ` [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch) matthew
@ 2012-10-02 18:46   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-10-02 18:46 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel, netdev

From: matthew@walster.org
Date: Tue,  2 Oct 2012 12:41:44 +0100

> From: Matthew Walster <matthew@walster.org>
> 
> Remove an old commented out piece of code.
> Remove an if(true) statement.
> Remove a set of braces that weren't strictly necessary.
> 
> All found by running checkpatch.pl against the code.
> 
> Signed-off-by: Matthew Walster <matthew@walster.org>

That comment and that unconditional if() are documentation.

Don't be an automaton and blindly make changes based upon
checkpatch.pl output.

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

* Re: [PATCH 2/2] net: ethernet: Remove obsolete comment
  2012-10-02 11:41 ` [PATCH 2/2] net: ethernet: Remove obsolete comment matthew
@ 2012-10-02 18:46   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-10-02 18:46 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel, netdev

From: matthew@walster.org
Date: Tue,  2 Oct 2012 12:41:45 +0100

> From: Matthew Walster <matthew@walster.org>
> 
> The deleted comment was related to code I've just removed in the previous patch.

The first change was wrong and therefore this change is also useless.

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

end of thread, other threads:[~2012-10-02 18:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 11:41 checkpatch run on net/ethernet matthew
2012-10-02 11:41 ` [PATCH 1/2] net: ethernet: clean out braces / old code (found via checkpatch) matthew
2012-10-02 18:46   ` David Miller
2012-10-02 11:41 ` [PATCH 2/2] net: ethernet: Remove obsolete comment matthew
2012-10-02 18:46   ` David Miller

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).