linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fix braces and comments codestyle
@ 2018-12-10 23:11 Darya Litvintseva
  2018-12-10 23:23 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Darya Litvintseva @ 2018-12-10 23:11 UTC (permalink / raw)
  Cc: alex.mikhalevich, litv.daria, David S. Miller, Paolo Abeni,
	netdev, linux-kernel

Signed-off-by: Darya Litvintseva <litv.daria@gmail.com>
---
 net/ethernet/eth.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index fd8faa0dfa61..3b430e245d58 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -90,9 +90,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev,
 	else
 		eth->h_proto = htons(len);
 
-	/*
-	 *      Set the source hardware address.
-	 */
+	/* Set the source hardware address.*/
 
 	if (!saddr)
 		saddr = dev->dev_addr;
@@ -103,9 +101,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev,
 		return ETH_HLEN;
 	}
 
-	/*
-	 *      Anyway, the loopback-device should never use this function...
-	 */
+	/* Anyway, the loopback-device should never use this function... */
 
 	if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
 		eth_zero_addr(eth->h_dest);
@@ -170,13 +166,11 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 			skb->pkt_type = PACKET_BROADCAST;
 		else
 			skb->pkt_type = PACKET_MULTICAST;
-	}
-	else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
+	} 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
+	/* Some variants of DSA tagging don't have an ethertype field
 	 * at all, so we check here whether one of those tagging
 	 * variants has been configured on the receiving interface,
 	 * and if so, set skb->protocol without looking at the packet.
@@ -187,8 +181,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	if (likely(eth_proto_is_802_3(eth->h_proto)))
 		return eth->h_proto;
 
-	/*
-	 *      This is a magic hack to spot IPX packets. Older Novell breaks
+	/*      This is a magic hack to spot IPX packets. Older Novell breaks
 	 *      the protocol design and runs IPX over 802.3 without an 802.2 LLC
 	 *      layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
 	 *      won't work for fault tolerant netware but does for the rest.
@@ -197,8 +190,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	if (sap && *sap == 0xFFFF)
 		return htons(ETH_P_802_3);
 
-	/*
-	 *      Real 802.2 LLC
+	/* Real 802.2 LLC
 	 */
 	return htons(ETH_P_802_2);
 }
@@ -212,6 +204,7 @@ EXPORT_SYMBOL(eth_type_trans);
 int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr)
 {
 	const struct ethhdr *eth = eth_hdr(skb);
+
 	memcpy(haddr, eth->h_source, ETH_ALEN);
 	return ETH_ALEN;
 }
@@ -355,7 +348,7 @@ void ether_setup(struct net_device *dev)
 {
 	dev->header_ops		= &eth_header_ops;
 	dev->type		= ARPHRD_ETHER;
-	dev->hard_header_len 	= ETH_HLEN;
+	dev->hard_header_len	= ETH_HLEN;
 	dev->min_header_len	= ETH_HLEN;
 	dev->mtu		= ETH_DATA_LEN;
 	dev->min_mtu		= ETH_MIN_MTU;
-- 
2.19.1


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

* Re: [PATCH] net: fix braces and comments codestyle
  2018-12-10 23:11 [PATCH] net: fix braces and comments codestyle Darya Litvintseva
@ 2018-12-10 23:23 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2018-12-10 23:23 UTC (permalink / raw)
  To: Darya Litvintseva
  Cc: alex.mikhalevich, David S. Miller, Paolo Abeni, netdev, linux-kernel

On Tue, 2018-12-11 at 02:11 +0300, Darya Litvintseva wrote:
> Signed-off-by: Darya Litvintseva <litv.daria@gmail.com>

Hello.

Most maintainers want some patch description
and not a blank commit message.

Whitespace only changes are sometimes not taken.

First kernel patches are best done in drivers/staging.

And some additional comments below...

cheers, Joe

> diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
[]
> @@ -90,9 +90,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev,
>  	else
>  		eth->h_proto = htons(len);
>  
> -	/*
> -	 *      Set the source hardware address.
> -	 */
> +	/* Set the source hardware address.*/

Most single line comments use a space before the */

> @@ -170,13 +166,11 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
>  			skb->pkt_type = PACKET_BROADCAST;
>  		else
>  			skb->pkt_type = PACKET_MULTICAST;
> -	}
> -	else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
> +	} else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
>  						   dev->dev_addr)))

please realign multiline statements to the open parenthesis

> @@ -187,8 +181,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
>  	if (likely(eth_proto_is_802_3(eth->h_proto)))
>  		return eth->h_proto;
>  
> -	/*
> -	 *      This is a magic hack to spot IPX packets. Older Novell breaks
> +	/*      This is a magic hack to spot IPX packets. Older Novell breaks
>  	 *      the protocol design and runs IPX over 802.3 without an 802.2 LLC
>  	 *      layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
>  	 *      won't work for fault tolerant netware but does for the rest.

Given the ipx protocol removal, perhaps this block
should be revisited.

commit e02554e9a4338c58e75fdfb0ef908a5adc86cba5
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Tue Nov 14 08:37:14 2017 -0800

    ipx: move Novell IPX protocol support into staging

commit 7a2e838d28cff6718a0bdf66164465402f8e40ed
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Jun 1 20:39:54 2018 +0200

    staging: ipx: delete it from the tree
    
    The ipx code moved into the staging tree back in November 2017 and no
    one has complained or even noticed it was gone.  Because of that, let's
    just delete it.

> @@ -197,8 +190,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
>  	if (sap && *sap == 0xFFFF)
>  		return htons(ETH_P_802_3);
>  
> -	/*
> -	 *      Real 802.2 LLC
> +	/* Real 802.2 LLC
>  	 */

better to move the closing */ up as a single line comment



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

end of thread, other threads:[~2018-12-10 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 23:11 [PATCH] net: fix braces and comments codestyle Darya Litvintseva
2018-12-10 23:23 ` Joe Perches

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