aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.c
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2010-12-31 13:59:33 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-01 16:57:56 -0500
commit2db9983a4318818845193bd577879c0620705e82 (patch)
treea77ed030edde71edb1c1b781f580cdfd642ac70d /net/tipc/core.c
parent0e65967e33be61e5f67727edd4ea829b47676fc0 (diff)
tipc: split variable assignments out of conditional expressions
Cleans up TIPC's source code to eliminate assigning values to variables within conditional expressions, improving code readability and reducing warnings from various code checker tools. These changes are purely cosmetic and do not alter the operation of TIPC in any way. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r--net/tipc/core.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 60b85ec6d106..e071579e0850 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -115,10 +115,11 @@ int tipc_core_start_net(unsigned long addr)
115{ 115{
116 int res; 116 int res;
117 117
118 if ((res = tipc_net_start(addr)) || 118 res = tipc_net_start(addr);
119 (res = tipc_eth_media_start())) { 119 if (!res)
120 res = tipc_eth_media_start();
121 if (res)
120 tipc_core_stop_net(); 122 tipc_core_stop_net();
121 }
122 return res; 123 return res;
123} 124}
124 125
@@ -157,15 +158,22 @@ static int tipc_core_start(void)
157 get_random_bytes(&tipc_random, sizeof(tipc_random)); 158 get_random_bytes(&tipc_random, sizeof(tipc_random));
158 tipc_mode = TIPC_NODE_MODE; 159 tipc_mode = TIPC_NODE_MODE;
159 160
160 if ((res = tipc_handler_start()) || 161 res = tipc_handler_start();
161 (res = tipc_ref_table_init(tipc_max_ports, tipc_random)) || 162 if (!res)
162 (res = tipc_nametbl_init()) || 163 res = tipc_ref_table_init(tipc_max_ports, tipc_random);
163 (res = tipc_k_signal((Handler)tipc_subscr_start, 0)) || 164 if (!res)
164 (res = tipc_k_signal((Handler)tipc_cfg_init, 0)) || 165 res = tipc_nametbl_init();
165 (res = tipc_netlink_start()) || 166 if (!res)
166 (res = tipc_socket_init())) { 167 res = tipc_k_signal((Handler)tipc_subscr_start, 0);
168 if (!res)
169 res = tipc_k_signal((Handler)tipc_cfg_init, 0);
170 if (!res)
171 res = tipc_netlink_start();
172 if (!res)
173 res = tipc_socket_init();
174 if (res)
167 tipc_core_stop(); 175 tipc_core_stop();
168 } 176
169 return res; 177 return res;
170} 178}
171 179
@@ -188,7 +196,8 @@ static int __init tipc_init(void)
188 tipc_max_nodes = CONFIG_TIPC_NODES; 196 tipc_max_nodes = CONFIG_TIPC_NODES;
189 tipc_net_id = 4711; 197 tipc_net_id = 4711;
190 198
191 if ((res = tipc_core_start())) 199 res = tipc_core_start();
200 if (res)
192 err("Unable to start in single node mode\n"); 201 err("Unable to start in single node mode\n");
193 else 202 else
194 info("Started in single node mode\n"); 203 info("Started in single node mode\n");