Commit 5670342c authored by Murali Karicheri's avatar Murali Karicheri Committed by David S. Miller

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: default avatarMurali Karicheri <m-karicheri2@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4730775
...@@ -67,7 +67,7 @@ static bool hsr_check_carrier(struct hsr_port *master) ...@@ -67,7 +67,7 @@ static bool hsr_check_carrier(struct hsr_port *master)
rcu_read_lock(); rcu_read_lock();
hsr_for_each_port(master->hsr, port) 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; has_carrier = true;
break; break;
} }
...@@ -88,15 +88,14 @@ static void hsr_check_announce(struct net_device *hsr_dev, ...@@ -88,15 +88,14 @@ static void hsr_check_announce(struct net_device *hsr_dev,
hsr = netdev_priv(hsr_dev); hsr = netdev_priv(hsr_dev);
if ((hsr_dev->operstate == IF_OPER_UP) if (hsr_dev->operstate == IF_OPER_UP && old_operstate != IF_OPER_UP) {
&& (old_operstate != IF_OPER_UP)) {
/* Went up */ /* Went up */
hsr->announce_count = 0; hsr->announce_count = 0;
mod_timer(&hsr->announce_timer, mod_timer(&hsr->announce_timer,
jiffies + msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL)); 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 */ /* Went down */
del_timer(&hsr->announce_timer); del_timer(&hsr->announce_timer);
} }
......
...@@ -77,12 +77,11 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) ...@@ -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; &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup;
} }
if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) && if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE &&
(hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)) hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)
return false; return false;
if ((hsrSupTag->HSR_TLV_Length != 12) && if (hsrSupTag->HSR_TLV_Length != 12 &&
(hsrSupTag->HSR_TLV_Length != hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload))
sizeof(struct hsr_sup_payload)))
return false; return false;
return true; return true;
...@@ -191,7 +190,7 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame, ...@@ -191,7 +190,7 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame,
if (frame->skb_hsr) if (frame->skb_hsr)
return skb_clone(frame->skb_hsr, GFP_ATOMIC); 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"); WARN_ONCE(1, "HSR: Bug: trying to create a tagged frame for a non-ring port");
return NULL; return NULL;
} }
...@@ -255,11 +254,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame) ...@@ -255,11 +254,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
continue; continue;
/* Don't deliver locally unless we should */ /* 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; continue;
/* Deliver frames directly addressed to us to master only */ /* 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; continue;
/* Don't send frame over port where it has been sent before */ /* 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,7 +266,7 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
frame->sequence_nr)) frame->sequence_nr))
continue; 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, hsr_handle_sup_frame(frame->skb_hsr,
frame->node_src, frame->node_src,
frame->port_rcv); frame->port_rcv);
...@@ -301,9 +300,9 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb, ...@@ -301,9 +300,9 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
frame->is_local_exclusive = false; frame->is_local_exclusive = false;
} }
if ((skb->pkt_type == PACKET_HOST) || if (skb->pkt_type == PACKET_HOST ||
(skb->pkt_type == PACKET_MULTICAST) || skb->pkt_type == PACKET_MULTICAST ||
(skb->pkt_type == PACKET_BROADCAST)) { skb->pkt_type == PACKET_BROADCAST) {
frame->is_local_dest = true; frame->is_local_dest = true;
} else { } else {
frame->is_local_dest = false; frame->is_local_dest = false;
......
...@@ -63,8 +63,8 @@ bool hsr_port_exists(const struct net_device *dev) ...@@ -63,8 +63,8 @@ bool hsr_port_exists(const struct net_device *dev)
static int hsr_check_dev_ok(struct net_device *dev) static int hsr_check_dev_ok(struct net_device *dev)
{ {
/* Don't allow HSR on non-ethernet like devices */ /* Don't allow HSR on non-ethernet like devices */
if ((dev->flags & IFF_LOOPBACK) || (dev->type != ARPHRD_ETHER) || if ((dev->flags & IFF_LOOPBACK) || dev->type != ARPHRD_ETHER ||
(dev->addr_len != ETH_ALEN)) { dev->addr_len != ETH_ALEN) {
netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n"); netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment