Re: [PATCH] net: fix braces and comments codestyle

From: Joe Perches
Date: Mon Dec 10 2018 - 18:23:24 EST


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

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@xxxxxxxxxxxxxxxxxx>
Date: Tue Nov 14 08:37:14 2017 -0800

ipx: move Novell IPX protocol support into staging

commit 7a2e838d28cff6718a0bdf66164465402f8e40ed
Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
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