summaryrefslogtreecommitdiffstats
path: root/net/hsr
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2019-04-05 13:31:23 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-06 21:32:20 -0400
commitd595b85a6cea56874cee16ddc739289f552a9a2f (patch)
tree26e5af9491ab70b63dbe92ebb75ad9d2f52d56fc /net/hsr
parentf1054c65bca637c220fe8e32648156459361bb99 (diff)
net: hsr: fix lines exceeding 80 characters
This patch fixes lines exceeding 80 characters. This is seen when ran checkpatch.pl with -f option for 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_forward.c3
-rw-r--r--net/hsr/hsr_framereg.c8
-rw-r--r--net/hsr/hsr_main.c3
-rw-r--r--net/hsr/hsr_main.h8
-rw-r--r--net/hsr/hsr_netlink.c31
5 files changed, 31 insertions, 22 deletions
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 04b5450c5a55..5346127708ae 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -75,7 +75,8 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)
75 75
76 hsrSupTag = &hsrV1Hdr->hsr_sup; 76 hsrSupTag = &hsrV1Hdr->hsr_sup;
77 } else { 77 } else {
78 hsrSupTag = &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; 78 hsrSupTag =
79 &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup;
79 } 80 }
80 81
81 if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) && 82 if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) &&
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 9af16cb68f76..5cd74d99abe9 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -255,7 +255,8 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr,
255 if (!node_curr->time_in_stale[i] && 255 if (!node_curr->time_in_stale[i] &&
256 time_after(node_curr->time_in[i], node_real->time_in[i])) { 256 time_after(node_curr->time_in[i], node_real->time_in[i])) {
257 node_real->time_in[i] = node_curr->time_in[i]; 257 node_real->time_in[i] = node_curr->time_in[i];
258 node_real->time_in_stale[i] = node_curr->time_in_stale[i]; 258 node_real->time_in_stale[i] =
259 node_curr->time_in_stale[i];
259 } 260 }
260 if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) 261 if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i]))
261 node_real->seq_out[i] = node_curr->seq_out[i]; 262 node_real->seq_out[i] = node_curr->seq_out[i];
@@ -308,7 +309,8 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
308 if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) 309 if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest))
309 return; 310 return;
310 311
311 node_dst = find_node_by_AddrA(&port->hsr->node_db, eth_hdr(skb)->h_dest); 312 node_dst = find_node_by_AddrA(&port->hsr->node_db,
313 eth_hdr(skb)->h_dest);
312 if (!node_dst) { 314 if (!node_dst) {
313 WARN_ONCE(1, "%s: Unknown node\n", __func__); 315 WARN_ONCE(1, "%s: Unknown node\n", __func__);
314 return; 316 return;
@@ -419,7 +421,7 @@ void hsr_prune_nodes(struct timer_list *t)
419 421
420 /* Prune old entries */ 422 /* Prune old entries */
421 if (time_is_before_jiffies(timestamp + 423 if (time_is_before_jiffies(timestamp +
422 msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { 424 msecs_to_jiffies(HSR_NODE_FORGET_TIME))) {
423 hsr_nl_nodedown(hsr, node->MacAddressA); 425 hsr_nl_nodedown(hsr, node->MacAddressA);
424 list_del_rcu(&node->mac_list); 426 list_del_rcu(&node->mac_list);
425 /* Note that we need to free this entry later: */ 427 /* Note that we need to free this entry later: */
diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c
index cd37d0011b42..b7a4cf62286b 100644
--- a/net/hsr/hsr_main.c
+++ b/net/hsr/hsr_main.c
@@ -63,7 +63,8 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
63 63
64 if (port->type == HSR_PT_SLAVE_A) { 64 if (port->type == HSR_PT_SLAVE_A) {
65 ether_addr_copy(master->dev->dev_addr, dev->dev_addr); 65 ether_addr_copy(master->dev->dev_addr, dev->dev_addr);
66 call_netdevice_notifiers(NETDEV_CHANGEADDR, master->dev); 66 call_netdevice_notifiers(NETDEV_CHANGEADDR,
67 master->dev);
67 } 68 }
68 69
69 /* Make sure we recognize frames from ourselves in hsr_rcv() */ 70 /* Make sure we recognize frames from ourselves in hsr_rcv() */
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
index 9b9909e89e9e..6f05dc90aa9b 100644
--- a/net/hsr/hsr_main.h
+++ b/net/hsr/hsr_main.h
@@ -83,8 +83,8 @@ static inline u16 get_hsr_tag_LSDU_size(struct hsr_tag *ht)
83 83
84static inline void set_hsr_tag_path(struct hsr_tag *ht, u16 path) 84static inline void set_hsr_tag_path(struct hsr_tag *ht, u16 path)
85{ 85{
86 ht->path_and_LSDU_size = htons( 86 ht->path_and_LSDU_size =
87 (ntohs(ht->path_and_LSDU_size) & 0x0FFF) | (path << 12)); 87 htons((ntohs(ht->path_and_LSDU_size) & 0x0FFF) | (path << 12));
88} 88}
89 89
90static inline void set_hsr_tag_LSDU_size(struct hsr_tag *ht, u16 LSDU_size) 90static inline void set_hsr_tag_LSDU_size(struct hsr_tag *ht, u16 LSDU_size)
@@ -171,8 +171,8 @@ struct hsr_priv {
171 struct timer_list prune_timer; 171 struct timer_list prune_timer;
172 int announce_count; 172 int announce_count;
173 u16 sequence_nr; 173 u16 sequence_nr;
174 u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ 174 u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */
175 u8 protVersion; /* Indicate if HSRv0 or HSRv1. */ 175 u8 protVersion; /* Indicate if HSRv0 or HSRv1. */
176 spinlock_t seqnr_lock; /* locking for sequence_nr */ 176 spinlock_t seqnr_lock; /* locking for sequence_nr */
177 unsigned char sup_multicast_addr[ETH_ALEN]; 177 unsigned char sup_multicast_addr[ETH_ALEN];
178}; 178};
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index bcc04d3e724f..110913e491c8 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -47,12 +47,14 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev,
47 netdev_info(dev, "HSR: Slave1 device not specified\n"); 47 netdev_info(dev, "HSR: Slave1 device not specified\n");
48 return -EINVAL; 48 return -EINVAL;
49 } 49 }
50 link[0] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE1])); 50 link[0] = __dev_get_by_index(src_net,
51 nla_get_u32(data[IFLA_HSR_SLAVE1]));
51 if (!data[IFLA_HSR_SLAVE2]) { 52 if (!data[IFLA_HSR_SLAVE2]) {
52 netdev_info(dev, "HSR: Slave2 device not specified\n"); 53 netdev_info(dev, "HSR: Slave2 device not specified\n");
53 return -EINVAL; 54 return -EINVAL;
54 } 55 }
55 link[1] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE2])); 56 link[1] = __dev_get_by_index(src_net,
57 nla_get_u32(data[IFLA_HSR_SLAVE2]));
56 58
57 if (!link[0] || !link[1]) 59 if (!link[0] || !link[1])
58 return -ENODEV; 60 return -ENODEV;
@@ -156,7 +158,8 @@ void hsr_nl_ringerror(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN],
156 if (!skb) 158 if (!skb)
157 goto fail; 159 goto fail;
158 160
159 msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0, HSR_C_RING_ERROR); 161 msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0,
162 HSR_C_RING_ERROR);
160 if (!msg_head) 163 if (!msg_head)
161 goto nla_put_failure; 164 goto nla_put_failure;
162 165
@@ -260,7 +263,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
260 goto invalid; 263 goto invalid;
261 264
262 hsr_dev = __dev_get_by_index(genl_info_net(info), 265 hsr_dev = __dev_get_by_index(genl_info_net(info),
263 nla_get_u32(info->attrs[HSR_A_IFINDEX])); 266 nla_get_u32(info->attrs[HSR_A_IFINDEX]));
264 if (!hsr_dev) 267 if (!hsr_dev)
265 goto invalid; 268 goto invalid;
266 if (!is_hsr_master(hsr_dev)) 269 if (!is_hsr_master(hsr_dev))
@@ -289,13 +292,14 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
289 292
290 hsr = netdev_priv(hsr_dev); 293 hsr = netdev_priv(hsr_dev);
291 res = hsr_get_node_data(hsr, 294 res = hsr_get_node_data(hsr,
292 (unsigned char *) nla_data(info->attrs[HSR_A_NODE_ADDR]), 295 (unsigned char *)
293 hsr_node_addr_b, 296 nla_data(info->attrs[HSR_A_NODE_ADDR]),
294 &addr_b_ifindex, 297 hsr_node_addr_b,
295 &hsr_node_if1_age, 298 &addr_b_ifindex,
296 &hsr_node_if1_seq, 299 &hsr_node_if1_age,
297 &hsr_node_if2_age, 300 &hsr_node_if1_seq,
298 &hsr_node_if2_seq); 301 &hsr_node_if2_age,
302 &hsr_node_if2_seq);
299 if (res < 0) 303 if (res < 0)
300 goto nla_put_failure; 304 goto nla_put_failure;
301 305
@@ -306,11 +310,12 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
306 310
307 if (addr_b_ifindex > -1) { 311 if (addr_b_ifindex > -1) {
308 res = nla_put(skb_out, HSR_A_NODE_ADDR_B, ETH_ALEN, 312 res = nla_put(skb_out, HSR_A_NODE_ADDR_B, ETH_ALEN,
309 hsr_node_addr_b); 313 hsr_node_addr_b);
310 if (res < 0) 314 if (res < 0)
311 goto nla_put_failure; 315 goto nla_put_failure;
312 316
313 res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX, addr_b_ifindex); 317 res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX,
318 addr_b_ifindex);
314 if (res < 0) 319 if (res < 0)
315 goto nla_put_failure; 320 goto nla_put_failure;
316 } 321 }