aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-11-08 13:48:28 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-02-24 17:05:17 -0500
commitb58343f9ea75f02ef48b984767511c6b3ba76eaf (patch)
tree9569124c832d5ff91f4a2191a13f31ac8c59f0d7 /net/tipc/net.c
parent077a26f029e76a5918edf9c1d44d5566eec719fc (diff)
tipc: Eliminate support for tipc_mode global variable
Removes all references to the global variable that records whether TIPC is running in "single node" mode or "network" mode, since this information can be easily deduced from the global variable that records TIPC's network address. (i.e. a non-zero network address means that TIPC is running in network mode.) The changes made update most existing mode-based checks to use the network address global variable. A few checks that are no longer needed are removed entirely, along with any associated code lying on non-executable control paths. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 2abd4be4933e..d4531b07076c 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -175,14 +175,10 @@ int tipc_net_start(u32 addr)
175{ 175{
176 char addr_string[16]; 176 char addr_string[16];
177 177
178 if (tipc_mode != TIPC_NODE_MODE)
179 return -ENOPROTOOPT;
180
181 tipc_subscr_stop(); 178 tipc_subscr_stop();
182 tipc_cfg_stop(); 179 tipc_cfg_stop();
183 180
184 tipc_own_addr = addr; 181 tipc_own_addr = addr;
185 tipc_mode = TIPC_NET_MODE;
186 tipc_named_reinit(); 182 tipc_named_reinit();
187 tipc_port_reinit(); 183 tipc_port_reinit();
188 184
@@ -201,10 +197,9 @@ void tipc_net_stop(void)
201{ 197{
202 struct tipc_node *node, *t_node; 198 struct tipc_node *node, *t_node;
203 199
204 if (tipc_mode != TIPC_NET_MODE) 200 if (!tipc_own_addr)
205 return; 201 return;
206 write_lock_bh(&tipc_net_lock); 202 write_lock_bh(&tipc_net_lock);
207 tipc_mode = TIPC_NODE_MODE;
208 tipc_bearer_stop(); 203 tipc_bearer_stop();
209 tipc_bclink_stop(); 204 tipc_bclink_stop();
210 list_for_each_entry_safe(node, t_node, &tipc_node_list, list) 205 list_for_each_entry_safe(node, t_node, &tipc_node_list, list)