Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] net: openswitch: flow_netlink.c: Fix indentation errors
@ 2021-05-03 18:17 Shubhankar Kuranagatti
  2021-05-03 20:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Shubhankar Kuranagatti @ 2021-05-03 18:17 UTC (permalink / raw)
  To: pshelar; +Cc: davem, kuba, netdev, dev, linux-kernel

Every subsequent line starts with a * of block comment
The closing */ is shifted to a new line
New line added after declaration
The repeasted word 'is' is omitted from comment block
This is done to maintain code uniformity

Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com>
---
 net/openvswitch/flow_netlink.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index fd1f809e9bc1..b774d93860ab 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -156,7 +156,8 @@ static bool match_validate(const struct sw_flow_match *match,
 	u64 mask_allowed = key_attrs;  /* At most allow all key attributes */
 
 	/* The following mask attributes allowed only if they
-	 * pass the validation tests. */
+	 * pass the validation tests.
+	 */
 	mask_allowed &= ~((1 << OVS_KEY_ATTR_IPV4)
 			| (1 << OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4)
 			| (1 << OVS_KEY_ATTR_IPV6)
@@ -2019,6 +2020,7 @@ static int __ovs_nla_put_key(const struct sw_flow_key *swkey,
 				goto nla_put_failure;
 	} else {
 		u16 upper_u16;
+
 		upper_u16 = !is_mask ? 0 : 0xffff;
 
 		if (nla_put_u32(skb, OVS_KEY_ATTR_IN_PORT,
@@ -2060,11 +2062,11 @@ static int __ovs_nla_put_key(const struct sw_flow_key *swkey,
 
 		if (swkey->eth.type == htons(ETH_P_802_2)) {
 			/*
-			* Ethertype 802.2 is represented in the netlink with omitted
-			* OVS_KEY_ATTR_ETHERTYPE in the flow key attribute, and
-			* 0xffff in the mask attribute.  Ethertype can also
-			* be wildcarded.
-			*/
+			 * Ethertype 802.2 is represented in the netlink with omitted
+			 * OVS_KEY_ATTR_ETHERTYPE in the flow key attribute, and
+			 * 0xffff in the mask attribute.  Ethertype can also
+			 * be wildcarded.
+			 */
 			if (is_mask && output->eth.type)
 				if (nla_put_be16(skb, OVS_KEY_ATTR_ETHERTYPE,
 							output->eth.type))
@@ -2329,7 +2331,8 @@ static void __ovs_nla_free_flow_actions(struct rcu_head *head)
 }
 
 /* Schedules 'sf_acts' to be freed after the next RCU grace period.
- * The caller must hold rcu_read_lock for this to be sensible. */
+ * The caller must hold rcu_read_lock for this to be sensible.
+ */
 void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *sf_acts)
 {
 	call_rcu(&sf_acts->rcu, __ovs_nla_free_flow_actions);
@@ -2446,6 +2449,7 @@ static int validate_and_copy_sample(struct net *net, const struct nlattr *attr,
 	memset(attrs, 0, sizeof(attrs));
 	nla_for_each_nested(a, attr, rem) {
 		int type = nla_type(a);
+
 		if (!type || type > OVS_SAMPLE_ATTR_MAX || attrs[type])
 			return -EINVAL;
 		attrs[type] = a;
@@ -3184,13 +3188,14 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
 
 		case OVS_ACTION_ATTR_POP_MPLS: {
 			__be16  proto;
+
 			if (vlan_tci & htons(VLAN_CFI_MASK) ||
 			    !eth_p_mpls(eth_type))
 				return -EINVAL;
 
 			/* Disallow subsequent L2.5+ set actions and mpls_pop
 			 * actions once the last MPLS label in the packet is
-			 * is popped as there is no check here to ensure that
+			 * popped as there is no check here to ensure that
 			 * the new eth type is valid and thus set actions could
 			 * write off the end of the packet or otherwise corrupt
 			 * it.
@@ -3255,7 +3260,8 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
 
 		case OVS_ACTION_ATTR_PUSH_ETH:
 			/* Disallow pushing an Ethernet header if one
-			 * is already present */
+			 * is already present
+			 */
 			if (mac_proto != MAC_PROTO_NONE)
 				return -EINVAL;
 			mac_proto = MAC_PROTO_ETHERNET;
-- 
2.17.1


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

* Re: [PATCH] net: openswitch: flow_netlink.c: Fix indentation errors
  2021-05-03 18:17 [PATCH] net: openswitch: flow_netlink.c: Fix indentation errors Shubhankar Kuranagatti
@ 2021-05-03 20:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2021-05-03 20:47 UTC (permalink / raw)
  To: shubhankarvk; +Cc: pshelar, kuba, netdev, dev, linux-kernel

From: Shubhankar Kuranagatti <shubhankarvk@gmail.com>
Date: Mon, 3 May 2021 23:47:06 +0530

> Every subsequent line starts with a * of block comment
> The closing */ is shifted to a new line
> New line added after declaration
> The repeasted word 'is' is omitted from comment block
> This is done to maintain code uniformity
> 
> Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com>
Please resubmit this when net-next opens back up.

Thank you.

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 18:17 [PATCH] net: openswitch: flow_netlink.c: Fix indentation errors Shubhankar Kuranagatti
2021-05-03 20:47 ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git