aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_stp.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-07-22 03:47:10 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-22 20:01:13 -0400
commit160d73b8455edb1a12967e207790b1a93a4cb0e1 (patch)
treeadba1755432a81fd4d258ecdeb2207d94e36be03 /net/bridge/br_stp.c
parent4ecb961c8b474ebef5aff55f715c7875e69dd57b (diff)
bridge: minor cleanups
Some minor cleanups that won't impact code: 1. Remove inline from non-critical functions; compiler will most likely inline them anyway. 2. Make function args const where possible. 3. Whitespace cleanup Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r--net/bridge/br_stp.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 4d651af57a90..ad0a3f7cf6cc 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -109,7 +109,6 @@ static void br_root_selection(struct net_bridge *br)
109 list_for_each_entry(p, &br->port_list, list) { 109 list_for_each_entry(p, &br->port_list, list) {
110 if (br_should_become_root_port(p, root_port)) 110 if (br_should_become_root_port(p, root_port))
111 root_port = p->port_no; 111 root_port = p->port_no;
112
113 } 112 }
114 113
115 br->root_port = root_port; 114 br->root_port = root_port;
@@ -145,7 +144,6 @@ void br_transmit_config(struct net_bridge_port *p)
145 struct br_config_bpdu bpdu; 144 struct br_config_bpdu bpdu;
146 struct net_bridge *br; 145 struct net_bridge *br;
147 146
148
149 if (timer_pending(&p->hold_timer)) { 147 if (timer_pending(&p->hold_timer)) {
150 p->config_pending = 1; 148 p->config_pending = 1;
151 return; 149 return;
@@ -181,8 +179,8 @@ void br_transmit_config(struct net_bridge_port *p)
181} 179}
182 180
183/* called under bridge lock */ 181/* called under bridge lock */
184static inline void br_record_config_information(struct net_bridge_port *p, 182static void br_record_config_information(struct net_bridge_port *p,
185 const struct br_config_bpdu *bpdu) 183 const struct br_config_bpdu *bpdu)
186{ 184{
187 p->designated_root = bpdu->root; 185 p->designated_root = bpdu->root;
188 p->designated_cost = bpdu->root_path_cost; 186 p->designated_cost = bpdu->root_path_cost;
@@ -195,7 +193,7 @@ static inline void br_record_config_information(struct net_bridge_port *p,
195} 193}
196 194
197/* called under bridge lock */ 195/* called under bridge lock */
198static inline void br_record_config_timeout_values(struct net_bridge *br, 196static void br_record_config_timeout_values(struct net_bridge *br,
199 const struct br_config_bpdu *bpdu) 197 const struct br_config_bpdu *bpdu)
200{ 198{
201 br->max_age = bpdu->max_age; 199 br->max_age = bpdu->max_age;
@@ -254,7 +252,8 @@ static void br_designated_port_selection(struct net_bridge *br)
254} 252}
255 253
256/* called under bridge lock */ 254/* called under bridge lock */
257static int br_supersedes_port_info(struct net_bridge_port *p, struct br_config_bpdu *bpdu) 255static int br_supersedes_port_info(const struct net_bridge_port *p,
256 const struct br_config_bpdu *bpdu)
258{ 257{
259 int t; 258 int t;
260 259
@@ -285,7 +284,7 @@ static int br_supersedes_port_info(struct net_bridge_port *p, struct br_config_b
285} 284}
286 285
287/* called under bridge lock */ 286/* called under bridge lock */
288static inline void br_topology_change_acknowledged(struct net_bridge *br) 287static void br_topology_change_acknowledged(struct net_bridge *br)
289{ 288{
290 br->topology_change_detected = 0; 289 br->topology_change_detected = 0;
291 del_timer(&br->tcn_timer); 290 del_timer(&br->tcn_timer);
@@ -327,7 +326,7 @@ void br_config_bpdu_generation(struct net_bridge *br)
327} 326}
328 327
329/* called under bridge lock */ 328/* called under bridge lock */
330static inline void br_reply(struct net_bridge_port *p) 329static void br_reply(struct net_bridge_port *p)
331{ 330{
332 br_transmit_config(p); 331 br_transmit_config(p);
333} 332}
@@ -381,8 +380,7 @@ static void br_make_forwarding(struct net_bridge_port *p)
381 p->state = BR_STATE_FORWARDING; 380 p->state = BR_STATE_FORWARDING;
382 br_topology_change_detection(br); 381 br_topology_change_detection(br);
383 del_timer(&p->forward_delay_timer); 382 del_timer(&p->forward_delay_timer);
384 } 383 } else if (br->stp_enabled == BR_KERNEL_STP)
385 else if (br->stp_enabled == BR_KERNEL_STP)
386 p->state = BR_STATE_LISTENING; 384 p->state = BR_STATE_LISTENING;
387 else 385 else
388 p->state = BR_STATE_LEARNING; 386 p->state = BR_STATE_LEARNING;
@@ -433,14 +431,15 @@ void br_port_state_selection(struct net_bridge *br)
433} 431}
434 432
435/* called under bridge lock */ 433/* called under bridge lock */
436static inline void br_topology_change_acknowledge(struct net_bridge_port *p) 434static void br_topology_change_acknowledge(struct net_bridge_port *p)
437{ 435{
438 p->topology_change_ack = 1; 436 p->topology_change_ack = 1;
439 br_transmit_config(p); 437 br_transmit_config(p);
440} 438}
441 439
442/* called under bridge lock */ 440/* called under bridge lock */
443void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu) 441void br_received_config_bpdu(struct net_bridge_port *p,
442 const struct br_config_bpdu *bpdu)
444{ 443{
445 struct net_bridge *br; 444 struct net_bridge *br;
446 int was_root; 445 int was_root;