summaryrefslogtreecommitdiffstats
path: root/net/hsr
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2019-04-05 13:31:25 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-06 21:32:20 -0400
commit5670342ced28b87f598d97e49d27bd99b38c1665 (patch)
treefe104e0b2c79c3dda111abdb76fb574bfb174f02 /net/hsr
parentd4730775ed4ba91615f462415ab66f49431ee794 (diff)
net: hsr: remove unnecessary paranthesis from the code
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr')
-rw-r--r--net/hsr/hsr_device.c7
-rw-r--r--net/hsr/hsr_forward.c23
-rw-r--r--net/hsr/hsr_slave.c4
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)
67 67
68 rcu_read_lock(); 68 rcu_read_lock();
69 hsr_for_each_port(master->hsr, port) 69 hsr_for_each_port(master->hsr, port)
70 if ((port->type != HSR_PT_MASTER) && is_slave_up(port->dev)) { 70 if (port->type != HSR_PT_MASTER && is_slave_up(port->dev)) {
71 has_carrier = true; 71 has_carrier = true;
72 break; 72 break;
73 } 73 }
@@ -88,15 +88,14 @@ static void hsr_check_announce(struct net_device *hsr_dev,
88 88
89 hsr = netdev_priv(hsr_dev); 89 hsr = netdev_priv(hsr_dev);
90 90
91 if ((hsr_dev->operstate == IF_OPER_UP) 91 if (hsr_dev->operstate == IF_OPER_UP && old_operstate != IF_OPER_UP) {
92 && (old_operstate != IF_OPER_UP)) {
93 /* Went up */ 92 /* Went up */
94 hsr->announce_count = 0; 93 hsr->announce_count = 0;
95 mod_timer(&hsr->announce_timer, 94 mod_timer(&hsr->announce_timer,
96 jiffies + msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL)); 95 jiffies + msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL));
97 } 96 }
98 97
99 if ((hsr_dev->operstate != IF_OPER_UP) && (old_operstate == IF_OPER_UP)) 98 if (hsr_dev->operstate != IF_OPER_UP && old_operstate == IF_OPER_UP)
100 /* Went down */ 99 /* Went down */
101 del_timer(&hsr->announce_timer); 100 del_timer(&hsr->announce_timer);
102} 101}
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)
77 &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; 77 &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup;
78 } 78 }
79 79
80 if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) && 80 if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE &&
81 (hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)) 81 hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)
82 return false; 82 return false;
83 if ((hsrSupTag->HSR_TLV_Length != 12) && 83 if (hsrSupTag->HSR_TLV_Length != 12 &&
84 (hsrSupTag->HSR_TLV_Length != 84 hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload))
85 sizeof(struct hsr_sup_payload)))
86 return false; 85 return false;
87 86
88 return true; 87 return true;
@@ -191,7 +190,7 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame,
191 if (frame->skb_hsr) 190 if (frame->skb_hsr)
192 return skb_clone(frame->skb_hsr, GFP_ATOMIC); 191 return skb_clone(frame->skb_hsr, GFP_ATOMIC);
193 192
194 if ((port->type != HSR_PT_SLAVE_A) && (port->type != HSR_PT_SLAVE_B)) { 193 if (port->type != HSR_PT_SLAVE_A && port->type != HSR_PT_SLAVE_B) {
195 WARN_ONCE(1, "HSR: Bug: trying to create a tagged frame for a non-ring port"); 194 WARN_ONCE(1, "HSR: Bug: trying to create a tagged frame for a non-ring port");
196 return NULL; 195 return NULL;
197 } 196 }
@@ -255,11 +254,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
255 continue; 254 continue;
256 255
257 /* Don't deliver locally unless we should */ 256 /* Don't deliver locally unless we should */
258 if ((port->type == HSR_PT_MASTER) && !frame->is_local_dest) 257 if (port->type == HSR_PT_MASTER && !frame->is_local_dest)
259 continue; 258 continue;
260 259
261 /* Deliver frames directly addressed to us to master only */ 260 /* Deliver frames directly addressed to us to master only */
262 if ((port->type != HSR_PT_MASTER) && frame->is_local_exclusive) 261 if (port->type != HSR_PT_MASTER && frame->is_local_exclusive)
263 continue; 262 continue;
264 263
265 /* Don't send frame over port where it has been sent before */ 264 /* 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)
267 frame->sequence_nr)) 266 frame->sequence_nr))
268 continue; 267 continue;
269 268
270 if (frame->is_supervision && (port->type == HSR_PT_MASTER)) { 269 if (frame->is_supervision && port->type == HSR_PT_MASTER) {
271 hsr_handle_sup_frame(frame->skb_hsr, 270 hsr_handle_sup_frame(frame->skb_hsr,
272 frame->node_src, 271 frame->node_src,
273 frame->port_rcv); 272 frame->port_rcv);
@@ -301,9 +300,9 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
301 frame->is_local_exclusive = false; 300 frame->is_local_exclusive = false;
302 } 301 }
303 302
304 if ((skb->pkt_type == PACKET_HOST) || 303 if (skb->pkt_type == PACKET_HOST ||
305 (skb->pkt_type == PACKET_MULTICAST) || 304 skb->pkt_type == PACKET_MULTICAST ||
306 (skb->pkt_type == PACKET_BROADCAST)) { 305 skb->pkt_type == PACKET_BROADCAST) {
307 frame->is_local_dest = true; 306 frame->is_local_dest = true;
308 } else { 307 } else {
309 frame->is_local_dest = false; 308 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)
63static int hsr_check_dev_ok(struct net_device *dev) 63static int hsr_check_dev_ok(struct net_device *dev)
64{ 64{
65 /* Don't allow HSR on non-ethernet like devices */ 65 /* Don't allow HSR on non-ethernet like devices */
66 if ((dev->flags & IFF_LOOPBACK) || (dev->type != ARPHRD_ETHER) || 66 if ((dev->flags & IFF_LOOPBACK) || dev->type != ARPHRD_ETHER ||
67 (dev->addr_len != ETH_ALEN)) { 67 dev->addr_len != ETH_ALEN) {
68 netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n"); 68 netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n");
69 return -EINVAL; 69 return -EINVAL;
70 } 70 }