mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <arvid.brodin@alten.se>,
	<a-kramer@ti.com>
Subject: [PATCH net 03/14] net: hsr: remove unnecessary paranthesis from the code
Date: Fri, 5 Apr 2019 13:31:25 -0400	[thread overview]
Message-ID: <20190405173136.18050-4-m-karicheri2@ti.com> (raw)
In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com>

This patch fixes unnecessary paranthesis from the code. This is
seen when ran checkpatch.pl -f option on files under net/hsr.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 net/hsr/hsr_device.c  |  7 +++----
 net/hsr/hsr_forward.c | 23 +++++++++++------------
 net/hsr/hsr_slave.c   |  4 ++--
 3 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 34b6d6e8020f..cf5c3951d35a 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -67,7 +67,7 @@ static bool hsr_check_carrier(struct hsr_port *master)
 
 	rcu_read_lock();
 	hsr_for_each_port(master->hsr, port)
-		if ((port->type != HSR_PT_MASTER) && is_slave_up(port->dev)) {
+		if (port->type != HSR_PT_MASTER && is_slave_up(port->dev)) {
 			has_carrier = true;
 			break;
 		}
@@ -88,15 +88,14 @@ static void hsr_check_announce(struct net_device *hsr_dev,
 
 	hsr = netdev_priv(hsr_dev);
 
-	if ((hsr_dev->operstate == IF_OPER_UP)
-			&& (old_operstate != IF_OPER_UP)) {
+	if (hsr_dev->operstate == IF_OPER_UP && old_operstate != IF_OPER_UP) {
 		/* Went up */
 		hsr->announce_count = 0;
 		mod_timer(&hsr->announce_timer,
 			  jiffies + msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL));
 	}
 
-	if ((hsr_dev->operstate != IF_OPER_UP) && (old_operstate == IF_OPER_UP))
+	if (hsr_dev->operstate != IF_OPER_UP && old_operstate == IF_OPER_UP)
 		/* Went down */
 		del_timer(&hsr->announce_timer);
 }
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 70220e5a389a..fdc191015208 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -77,12 +77,11 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)
 		     &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup;
 	}
 
-	if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) &&
-	    (hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK))
+	if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE &&
+	    hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)
 		return false;
-	if ((hsrSupTag->HSR_TLV_Length != 12) &&
-			(hsrSupTag->HSR_TLV_Length !=
-					sizeof(struct hsr_sup_payload)))
+	if (hsrSupTag->HSR_TLV_Length != 12 &&
+	    hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload))
 		return false;
 
 	return true;
@@ -191,7 +190,7 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame,
 	if (frame->skb_hsr)
 		return skb_clone(frame->skb_hsr, GFP_ATOMIC);
 
-	if ((port->type != HSR_PT_SLAVE_A) && (port->type != HSR_PT_SLAVE_B)) {
+	if (port->type != HSR_PT_SLAVE_A && port->type != HSR_PT_SLAVE_B) {
 		WARN_ONCE(1, "HSR: Bug: trying to create a tagged frame for a non-ring port");
 		return NULL;
 	}
@@ -255,11 +254,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
 			continue;
 
 		/* Don't deliver locally unless we should */
-		if ((port->type == HSR_PT_MASTER) && !frame->is_local_dest)
+		if (port->type == HSR_PT_MASTER && !frame->is_local_dest)
 			continue;
 
 		/* Deliver frames directly addressed to us to master only */
-		if ((port->type != HSR_PT_MASTER) && frame->is_local_exclusive)
+		if (port->type != HSR_PT_MASTER && frame->is_local_exclusive)
 			continue;
 
 		/* Don't send frame over port where it has been sent before */
@@ -267,7 +266,7 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
 					   frame->sequence_nr))
 			continue;
 
-		if (frame->is_supervision && (port->type == HSR_PT_MASTER)) {
+		if (frame->is_supervision && port->type == HSR_PT_MASTER) {
 			hsr_handle_sup_frame(frame->skb_hsr,
 					     frame->node_src,
 					     frame->port_rcv);
@@ -301,9 +300,9 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
 		frame->is_local_exclusive = false;
 	}
 
-	if ((skb->pkt_type == PACKET_HOST) ||
-	    (skb->pkt_type == PACKET_MULTICAST) ||
-	    (skb->pkt_type == PACKET_BROADCAST)) {
+	if (skb->pkt_type == PACKET_HOST ||
+	    skb->pkt_type == PACKET_MULTICAST ||
+	    skb->pkt_type == PACKET_BROADCAST) {
 		frame->is_local_dest = true;
 	} else {
 		frame->is_local_dest = false;
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index 80151c255a1d..d506c694ee25 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -63,8 +63,8 @@ bool hsr_port_exists(const struct net_device *dev)
 static int hsr_check_dev_ok(struct net_device *dev)
 {
 	/* Don't allow HSR on non-ethernet like devices */
-	if ((dev->flags & IFF_LOOPBACK) || (dev->type != ARPHRD_ETHER) ||
-	    (dev->addr_len != ETH_ALEN)) {
+	if ((dev->flags & IFF_LOOPBACK) || dev->type != ARPHRD_ETHER ||
+	    dev->addr_len != ETH_ALEN) {
 		netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n");
 		return -EINVAL;
 	}
-- 
2.17.0


  parent reply	other threads:[~2019-04-05 17:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 17:31 [PATCH net 00/14] net: hsr: improvements and bug fixes Murali Karicheri
2019-04-05 17:31 ` [PATCH net 01/14] net: hsr: fix lines exceeding 80 characters Murali Karicheri
2019-04-05 17:31 ` [PATCH net 02/14] net: hsr: fix multiple blank lines in the code Murali Karicheri
2019-04-05 17:31 ` Murali Karicheri [this message]
2019-04-05 17:31 ` [PATCH net 04/14] net: hsr: fix alignment issues in the code for functions Murali Karicheri
2019-04-05 17:31 ` [PATCH net 05/14] net: hsr: fix lines that ends with a '(' Murali Karicheri
2019-04-05 17:31 ` [PATCH net 06/14] net: hsr: fix NULL checks in the code Murali Karicheri
2019-04-05 17:31 ` [PATCH net 07/14] net: hsr: remove unnecessary space after a cast Murali Karicheri
2019-04-05 17:31 ` [PATCH net 08/14] net: hsr: fix placement of logical operator in a multi-line statement Murali Karicheri
2019-04-05 17:31 ` [PATCH net 09/14] net: hsr: add missing space around operator in code Murali Karicheri
2019-04-05 17:31 ` [PATCH net 10/14] net: hsr: remove camel case usage in the code Murali Karicheri
2019-04-05 17:31 ` [PATCH net 11/14] net: hsr: add blank line after function declaration Murali Karicheri
2019-04-05 17:31 ` [PATCH net 12/14] net: hsr: convert to SPDX identifier Murali Karicheri
2019-04-05 17:31 ` [PATCH net 13/14] net: hsr: add debugfs support for display node list Murali Karicheri
2019-04-05 17:31 ` [PATCH net 14/14] net: hsr: Fix node prune function for forget time expiry Murali Karicheri
2019-04-07  1:32 ` [PATCH net 00/14] net: hsr: improvements and bug fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190405173136.18050-4-m-karicheri2@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=a-kramer@ti.com \
    --cc=arvid.brodin@alten.se \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®