aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2010-12-31 13:59:32 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-01 16:57:56 -0500
commit0e65967e33be61e5f67727edd4ea829b47676fc0 (patch)
tree1135d631e0cb88af3f8b060b8c32a130315542d8 /net
parent25860c3bd5bd1db236d4fd5826d76127d677dc28 (diff)
tipc: cleanup various cosmetic whitespace issues
Cleans up TIPC's source code to eliminate deviations from generally accepted coding conventions relating to leading/trailing white space and white space around commas, braces, cases, and sizeof. 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')
-rw-r--r--net/tipc/Kconfig2
-rw-r--r--net/tipc/bcast.c2
-rw-r--r--net/tipc/config.c3
-rw-r--r--net/tipc/discover.c2
-rw-r--r--net/tipc/eth_media.c5
-rw-r--r--net/tipc/link.c31
-rw-r--r--net/tipc/link.h4
-rw-r--r--net/tipc/msg.c56
-rw-r--r--net/tipc/msg.h8
-rw-r--r--net/tipc/name_table.c14
-rw-r--r--net/tipc/name_table.h2
-rw-r--r--net/tipc/node.c2
-rw-r--r--net/tipc/port.c15
-rw-r--r--net/tipc/port.h2
-rw-r--r--net/tipc/ref.c6
-rw-r--r--net/tipc/socket.c24
-rw-r--r--net/tipc/subscr.c2
17 files changed, 86 insertions, 94 deletions
diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig
index 0e7ce30fd567..0436927369f3 100644
--- a/net/tipc/Kconfig
+++ b/net/tipc/Kconfig
@@ -50,7 +50,7 @@ config TIPC_PORTS
50 Specifies how many ports can be supported by a node. 50 Specifies how many ports can be supported by a node.
51 Can range from 127 to 65535 ports; default is 8191. 51 Can range from 127 to 65535 ports; default is 8191.
52 52
53 Setting this to a smaller value saves some memory, 53 Setting this to a smaller value saves some memory,
54 setting it to higher allows for more ports. 54 setting it to higher allows for more ports.
55 55
56config TIPC_LOG 56config TIPC_LOG
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index c0f3b096e7f5..9de32564984a 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -428,7 +428,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
428 static int rx_count = 0; 428 static int rx_count = 0;
429#endif 429#endif
430 struct tipc_msg *msg = buf_msg(buf); 430 struct tipc_msg *msg = buf_msg(buf);
431 struct tipc_node* node = tipc_node_find(msg_prevnode(msg)); 431 struct tipc_node *node = tipc_node_find(msg_prevnode(msg));
432 u32 next_in; 432 u32 next_in;
433 u32 seqno; 433 u32 seqno;
434 struct sk_buff *deferred; 434 struct sk_buff *deferred;
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 6c67132f8652..e16750dcf3c1 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -322,8 +322,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
322 } else if (!tipc_remote_management) { 322 } else if (!tipc_remote_management) {
323 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE); 323 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE);
324 goto exit; 324 goto exit;
325 } 325 } else if (cmd >= 0x4000) {
326 else if (cmd >= 0x4000) {
327 u32 domain = 0; 326 u32 domain = 0;
328 327
329 if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) || 328 if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) ||
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index be28f5adc770..fa026bd91a68 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -130,7 +130,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
130 u32 net_id = msg_bc_netid(msg); 130 u32 net_id = msg_bc_netid(msg);
131 u32 type = msg_type(msg); 131 u32 type = msg_type(msg);
132 132
133 msg_get_media_addr(msg,&media_addr); 133 msg_get_media_addr(msg, &media_addr);
134 buf_discard(buf); 134 buf_discard(buf);
135 135
136 if (net_id != tipc_net_id) 136 if (net_id != tipc_net_id)
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 101d9cb6a559..5dfe66357794 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -144,7 +144,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
144 144
145 /* Find device with specified name */ 145 /* Find device with specified name */
146 146
147 for_each_netdev(&init_net, pdev){ 147 for_each_netdev(&init_net, pdev) {
148 if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) { 148 if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
149 dev = pdev; 149 dev = pdev;
150 break; 150 break;
@@ -155,7 +155,8 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
155 155
156 /* Find Ethernet bearer for device (or create one) */ 156 /* Find Ethernet bearer for device (or create one) */
157 157
158 for (;(eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev); eb_ptr++); 158 while ((eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev))
159 eb_ptr++;
159 if (eb_ptr == stop) 160 if (eb_ptr == stop)
160 return -EDQUOT; 161 return -EDQUOT;
161 if (!eb_ptr->dev) { 162 if (!eb_ptr->dev) {
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 647f2ecfde50..ef203a1581cd 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -977,8 +977,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
977 l_ptr->next_out = buf; 977 l_ptr->next_out = buf;
978 return res; 978 return res;
979 } 979 }
980 } 980 } else
981 else
982 *used_max_pkt = l_ptr->max_pkt; 981 *used_max_pkt = l_ptr->max_pkt;
983 } 982 }
984 return tipc_link_send_buf(l_ptr, buf); /* All other cases */ 983 return tipc_link_send_buf(l_ptr, buf); /* All other cases */
@@ -1132,10 +1131,10 @@ static int link_send_sections_long(struct port *sender,
1132 struct tipc_node *node; 1131 struct tipc_node *node;
1133 struct tipc_msg *hdr = &sender->publ.phdr; 1132 struct tipc_msg *hdr = &sender->publ.phdr;
1134 u32 dsz = msg_data_sz(hdr); 1133 u32 dsz = msg_data_sz(hdr);
1135 u32 max_pkt,fragm_sz,rest; 1134 u32 max_pkt, fragm_sz, rest;
1136 struct tipc_msg fragm_hdr; 1135 struct tipc_msg fragm_hdr;
1137 struct sk_buff *buf,*buf_chain,*prev; 1136 struct sk_buff *buf, *buf_chain, *prev;
1138 u32 fragm_crs,fragm_rest,hsz,sect_rest; 1137 u32 fragm_crs, fragm_rest, hsz, sect_rest;
1139 const unchar *sect_crs; 1138 const unchar *sect_crs;
1140 int curr_sect; 1139 int curr_sect;
1141 u32 fragm_no; 1140 u32 fragm_no;
@@ -1212,7 +1211,7 @@ error:
1212 /* Initiate new fragment: */ 1211 /* Initiate new fragment: */
1213 if (rest <= fragm_sz) { 1212 if (rest <= fragm_sz) {
1214 fragm_sz = rest; 1213 fragm_sz = rest;
1215 msg_set_type(&fragm_hdr,LAST_FRAGMENT); 1214 msg_set_type(&fragm_hdr, LAST_FRAGMENT);
1216 } else { 1215 } else {
1217 msg_set_type(&fragm_hdr, FRAGMENT); 1216 msg_set_type(&fragm_hdr, FRAGMENT);
1218 } 1217 }
@@ -1229,8 +1228,7 @@ error:
1229 fragm_crs = INT_H_SIZE; 1228 fragm_crs = INT_H_SIZE;
1230 fragm_rest = fragm_sz; 1229 fragm_rest = fragm_sz;
1231 } 1230 }
1232 } 1231 } while (rest > 0);
1233 while (rest > 0);
1234 1232
1235 /* 1233 /*
1236 * Now we have a buffer chain. Select a link and check 1234 * Now we have a buffer chain. Select a link and check
@@ -1333,7 +1331,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1333 buf = l_ptr->proto_msg_queue; 1331 buf = l_ptr->proto_msg_queue;
1334 if (buf) { 1332 if (buf) {
1335 msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); 1333 msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1));
1336 msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in); 1334 msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in);
1337 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { 1335 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) {
1338 l_ptr->unacked_window = 0; 1336 l_ptr->unacked_window = 0;
1339 buf_discard(buf); 1337 buf_discard(buf);
@@ -1847,8 +1845,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
1847 } 1845 }
1848 prev = crs; 1846 prev = crs;
1849 crs = crs->next; 1847 crs = crs->next;
1850 } 1848 } while (crs);
1851 while (crs);
1852 1849
1853 /* Message is a duplicate of an existing message */ 1850 /* Message is a duplicate of an existing message */
1854 1851
@@ -2215,11 +2212,11 @@ void tipc_link_changeover(struct link *l_ptr)
2215 2212
2216 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) { 2213 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) {
2217 struct tipc_msg *m = msg_get_wrapped(msg); 2214 struct tipc_msg *m = msg_get_wrapped(msg);
2218 unchar* pos = (unchar*)m; 2215 unchar *pos = (unchar *)m;
2219 2216
2220 msgcount = msg_msgcnt(msg); 2217 msgcount = msg_msgcnt(msg);
2221 while (msgcount--) { 2218 while (msgcount--) {
2222 msg_set_seqno(m,msg_seqno(msg)); 2219 msg_set_seqno(m, msg_seqno(msg));
2223 tipc_link_tunnel(l_ptr, &tunnel_hdr, m, 2220 tipc_link_tunnel(l_ptr, &tunnel_hdr, m,
2224 msg_link_selector(m)); 2221 msg_link_selector(m));
2225 pos += align(msg_size(m)); 2222 pos += align(msg_size(m));
@@ -2321,7 +2318,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
2321 if (msg_typ == DUPLICATE_MSG) { 2318 if (msg_typ == DUPLICATE_MSG) {
2322 if (less(msg_seqno(msg), mod(dest_link->next_in_no))) 2319 if (less(msg_seqno(msg), mod(dest_link->next_in_no)))
2323 goto exit; 2320 goto exit;
2324 *buf = buf_extract(tunnel_buf,INT_H_SIZE); 2321 *buf = buf_extract(tunnel_buf, INT_H_SIZE);
2325 if (*buf == NULL) { 2322 if (*buf == NULL) {
2326 warn("Link changeover error, duplicate msg dropped\n"); 2323 warn("Link changeover error, duplicate msg dropped\n");
2327 goto exit; 2324 goto exit;
@@ -2552,8 +2549,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2552 /* Prepare buffer for subsequent fragments. */ 2549 /* Prepare buffer for subsequent fragments. */
2553 2550
2554 set_long_msg_seqno(pbuf, long_msg_seq_no); 2551 set_long_msg_seqno(pbuf, long_msg_seq_no);
2555 set_fragm_size(pbuf,fragm_sz); 2552 set_fragm_size(pbuf, fragm_sz);
2556 set_expected_frags(pbuf,exp_fragm_cnt - 1); 2553 set_expected_frags(pbuf, exp_fragm_cnt - 1);
2557 } else { 2554 } else {
2558 warn("Link unable to reassemble fragmented message\n"); 2555 warn("Link unable to reassemble fragmented message\n");
2559 } 2556 }
@@ -2580,7 +2577,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2580 *m = buf_msg(pbuf); 2577 *m = buf_msg(pbuf);
2581 return 1; 2578 return 1;
2582 } 2579 }
2583 set_expected_frags(pbuf,exp_frags); 2580 set_expected_frags(pbuf, exp_frags);
2584 return 0; 2581 return 0;
2585 } 2582 }
2586 buf_discard(fbuf); 2583 buf_discard(fbuf);
diff --git a/net/tipc/link.h b/net/tipc/link.h
index eca19c247b79..70967e637027 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -229,8 +229,8 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_
229void tipc_link_reset(struct link *l_ptr); 229void tipc_link_reset(struct link *l_ptr);
230int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); 230int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
231int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf); 231int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
232u32 tipc_link_get_max_pkt(u32 dest,u32 selector); 232u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
233int tipc_link_send_sections_fast(struct port* sender, 233int tipc_link_send_sections_fast(struct port *sender,
234 struct iovec const *msg_sect, 234 struct iovec const *msg_sect,
235 const u32 num_sect, 235 const u32 num_sect,
236 u32 destnode); 236 u32 destnode);
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 2571ffb4d350..e81d43a8ea3d 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -91,7 +91,7 @@ int tipc_msg_calc_data_size(struct iovec const *msg_sect, u32 num_sect)
91 91
92int tipc_msg_build(struct tipc_msg *hdr, 92int tipc_msg_build(struct tipc_msg *hdr,
93 struct iovec const *msg_sect, u32 num_sect, 93 struct iovec const *msg_sect, u32 num_sect,
94 int max_size, int usrmem, struct sk_buff** buf) 94 int max_size, int usrmem, struct sk_buff **buf)
95{ 95{
96 int dsz, sz, hsz, pos, res, cnt; 96 int dsz, sz, hsz, pos, res, cnt;
97 97
@@ -161,10 +161,10 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
161 tipc_printf(buf, "LAST:"); 161 tipc_printf(buf, "LAST:");
162 break; 162 break;
163 default: 163 default:
164 tipc_printf(buf, "UNKNOWN:%x",msg_type(msg)); 164 tipc_printf(buf, "UNKNOWN:%x", msg_type(msg));
165 165
166 } 166 }
167 tipc_printf(buf, "NO(%u/%u):",msg_long_msgno(msg), 167 tipc_printf(buf, "NO(%u/%u):", msg_long_msgno(msg),
168 msg_fragm_no(msg)); 168 msg_fragm_no(msg));
169 break; 169 break;
170 case TIPC_LOW_IMPORTANCE: 170 case TIPC_LOW_IMPORTANCE:
@@ -190,7 +190,7 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
190 tipc_printf(buf, "DIR:"); 190 tipc_printf(buf, "DIR:");
191 break; 191 break;
192 default: 192 default:
193 tipc_printf(buf, "UNKNOWN TYPE %u",msg_type(msg)); 193 tipc_printf(buf, "UNKNOWN TYPE %u", msg_type(msg));
194 } 194 }
195 if (msg_routed(msg) && !msg_non_seq(msg)) 195 if (msg_routed(msg) && !msg_non_seq(msg))
196 tipc_printf(buf, "ROUT:"); 196 tipc_printf(buf, "ROUT:");
@@ -208,7 +208,7 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
208 tipc_printf(buf, "WDRW:"); 208 tipc_printf(buf, "WDRW:");
209 break; 209 break;
210 default: 210 default:
211 tipc_printf(buf, "UNKNOWN:%x",msg_type(msg)); 211 tipc_printf(buf, "UNKNOWN:%x", msg_type(msg));
212 } 212 }
213 if (msg_routed(msg)) 213 if (msg_routed(msg))
214 tipc_printf(buf, "ROUT:"); 214 tipc_printf(buf, "ROUT:");
@@ -227,39 +227,39 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
227 break; 227 break;
228 case CONN_ACK: 228 case CONN_ACK:
229 tipc_printf(buf, "CONN_ACK:"); 229 tipc_printf(buf, "CONN_ACK:");
230 tipc_printf(buf, "ACK(%u):",msg_msgcnt(msg)); 230 tipc_printf(buf, "ACK(%u):", msg_msgcnt(msg));
231 break; 231 break;
232 default: 232 default:
233 tipc_printf(buf, "UNKNOWN TYPE:%x",msg_type(msg)); 233 tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg));
234 } 234 }
235 if (msg_routed(msg)) 235 if (msg_routed(msg))
236 tipc_printf(buf, "ROUT:"); 236 tipc_printf(buf, "ROUT:");
237 if (msg_reroute_cnt(msg)) 237 if (msg_reroute_cnt(msg))
238 tipc_printf(buf, "REROUTED(%u):",msg_reroute_cnt(msg)); 238 tipc_printf(buf, "REROUTED(%u):", msg_reroute_cnt(msg));
239 break; 239 break;
240 case LINK_PROTOCOL: 240 case LINK_PROTOCOL:
241 tipc_printf(buf, "PROT:TIM(%u):",msg_timestamp(msg)); 241 tipc_printf(buf, "PROT:TIM(%u):", msg_timestamp(msg));
242 switch (msg_type(msg)) { 242 switch (msg_type(msg)) {
243 case STATE_MSG: 243 case STATE_MSG:
244 tipc_printf(buf, "STATE:"); 244 tipc_printf(buf, "STATE:");
245 tipc_printf(buf, "%s:",msg_probe(msg) ? "PRB" :""); 245 tipc_printf(buf, "%s:", msg_probe(msg) ? "PRB" : "");
246 tipc_printf(buf, "NXS(%u):",msg_next_sent(msg)); 246 tipc_printf(buf, "NXS(%u):", msg_next_sent(msg));
247 tipc_printf(buf, "GAP(%u):",msg_seq_gap(msg)); 247 tipc_printf(buf, "GAP(%u):", msg_seq_gap(msg));
248 tipc_printf(buf, "LSTBC(%u):",msg_last_bcast(msg)); 248 tipc_printf(buf, "LSTBC(%u):", msg_last_bcast(msg));
249 break; 249 break;
250 case RESET_MSG: 250 case RESET_MSG:
251 tipc_printf(buf, "RESET:"); 251 tipc_printf(buf, "RESET:");
252 if (msg_size(msg) != msg_hdr_sz(msg)) 252 if (msg_size(msg) != msg_hdr_sz(msg))
253 tipc_printf(buf, "BEAR:%s:",msg_data(msg)); 253 tipc_printf(buf, "BEAR:%s:", msg_data(msg));
254 break; 254 break;
255 case ACTIVATE_MSG: 255 case ACTIVATE_MSG:
256 tipc_printf(buf, "ACTIVATE:"); 256 tipc_printf(buf, "ACTIVATE:");
257 break; 257 break;
258 default: 258 default:
259 tipc_printf(buf, "UNKNOWN TYPE:%x",msg_type(msg)); 259 tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg));
260 } 260 }
261 tipc_printf(buf, "PLANE(%c):",msg_net_plane(msg)); 261 tipc_printf(buf, "PLANE(%c):", msg_net_plane(msg));
262 tipc_printf(buf, "SESS(%u):",msg_session(msg)); 262 tipc_printf(buf, "SESS(%u):", msg_session(msg));
263 break; 263 break;
264 case CHANGEOVER_PROTOCOL: 264 case CHANGEOVER_PROTOCOL:
265 tipc_printf(buf, "TUNL:"); 265 tipc_printf(buf, "TUNL:");
@@ -269,10 +269,10 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
269 break; 269 break;
270 case ORIGINAL_MSG: 270 case ORIGINAL_MSG:
271 tipc_printf(buf, "ORIG:"); 271 tipc_printf(buf, "ORIG:");
272 tipc_printf(buf, "EXP(%u)",msg_msgcnt(msg)); 272 tipc_printf(buf, "EXP(%u)", msg_msgcnt(msg));
273 break; 273 break;
274 default: 274 default:
275 tipc_printf(buf, "UNKNOWN TYPE:%x",msg_type(msg)); 275 tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg));
276 } 276 }
277 break; 277 break;
278 case ROUTE_DISTRIBUTOR: 278 case ROUTE_DISTRIBUTOR:
@@ -280,26 +280,26 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
280 switch (msg_type(msg)) { 280 switch (msg_type(msg)) {
281 case EXT_ROUTING_TABLE: 281 case EXT_ROUTING_TABLE:
282 tipc_printf(buf, "EXT_TBL:"); 282 tipc_printf(buf, "EXT_TBL:");
283 tipc_printf(buf, "TO:%x:",msg_remote_node(msg)); 283 tipc_printf(buf, "TO:%x:", msg_remote_node(msg));
284 break; 284 break;
285 case LOCAL_ROUTING_TABLE: 285 case LOCAL_ROUTING_TABLE:
286 tipc_printf(buf, "LOCAL_TBL:"); 286 tipc_printf(buf, "LOCAL_TBL:");
287 tipc_printf(buf, "TO:%x:",msg_remote_node(msg)); 287 tipc_printf(buf, "TO:%x:", msg_remote_node(msg));
288 break; 288 break;
289 case SLAVE_ROUTING_TABLE: 289 case SLAVE_ROUTING_TABLE:
290 tipc_printf(buf, "DP_TBL:"); 290 tipc_printf(buf, "DP_TBL:");
291 tipc_printf(buf, "TO:%x:",msg_remote_node(msg)); 291 tipc_printf(buf, "TO:%x:", msg_remote_node(msg));
292 break; 292 break;
293 case ROUTE_ADDITION: 293 case ROUTE_ADDITION:
294 tipc_printf(buf, "ADD:"); 294 tipc_printf(buf, "ADD:");
295 tipc_printf(buf, "TO:%x:",msg_remote_node(msg)); 295 tipc_printf(buf, "TO:%x:", msg_remote_node(msg));
296 break; 296 break;
297 case ROUTE_REMOVAL: 297 case ROUTE_REMOVAL:
298 tipc_printf(buf, "REMOVE:"); 298 tipc_printf(buf, "REMOVE:");
299 tipc_printf(buf, "TO:%x:",msg_remote_node(msg)); 299 tipc_printf(buf, "TO:%x:", msg_remote_node(msg));
300 break; 300 break;
301 default: 301 default:
302 tipc_printf(buf, "UNKNOWN TYPE:%x",msg_type(msg)); 302 tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg));
303 } 303 }
304 break; 304 break;
305 case LINK_CONFIG: 305 case LINK_CONFIG:
@@ -312,7 +312,7 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
312 tipc_printf(buf, "DSC_RESP:"); 312 tipc_printf(buf, "DSC_RESP:");
313 break; 313 break;
314 default: 314 default:
315 tipc_printf(buf, "UNKNOWN TYPE:%x:",msg_type(msg)); 315 tipc_printf(buf, "UNKNOWN TYPE:%x:", msg_type(msg));
316 break; 316 break;
317 } 317 }
318 break; 318 break;
@@ -393,8 +393,8 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
393 } 393 }
394 394
395 if (msg_user(msg) == LINK_CONFIG) { 395 if (msg_user(msg) == LINK_CONFIG) {
396 u32* raw = (u32*)msg; 396 u32 *raw = (u32 *)msg;
397 struct tipc_media_addr* orig = (struct tipc_media_addr*)&raw[5]; 397 struct tipc_media_addr *orig = (struct tipc_media_addr *)&raw[5];
398 tipc_printf(buf, ":REQL(%u):", msg_req_links(msg)); 398 tipc_printf(buf, ":REQL(%u):", msg_req_links(msg));
399 tipc_printf(buf, ":DDOM(%x):", msg_dest_domain(msg)); 399 tipc_printf(buf, ":DDOM(%x):", msg_dest_domain(msg));
400 tipc_printf(buf, ":NETID(%u):", msg_bc_netid(msg)); 400 tipc_printf(buf, ":NETID(%u):", msg_bc_netid(msg));
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 68b65ef3e74b..92c4c4fd7b3f 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -174,7 +174,7 @@ static inline u32 msg_hdr_sz(struct tipc_msg *m)
174 return msg_bits(m, 0, 21, 0xf) << 2; 174 return msg_bits(m, 0, 21, 0xf) << 2;
175} 175}
176 176
177static inline void msg_set_hdr_sz(struct tipc_msg *m,u32 n) 177static inline void msg_set_hdr_sz(struct tipc_msg *m, u32 n)
178{ 178{
179 msg_set_bits(m, 0, 21, 0xf, n>>2); 179 msg_set_bits(m, 0, 21, 0xf, n>>2);
180} 180}
@@ -425,7 +425,7 @@ static inline u32 msg_routed(struct tipc_msg *m)
425{ 425{
426 if (likely(msg_short(m))) 426 if (likely(msg_short(m)))
427 return 0; 427 return 0;
428 return(msg_destnode(m) ^ msg_orignode(m)) >> 11; 428 return (msg_destnode(m) ^ msg_orignode(m)) >> 11;
429} 429}
430 430
431static inline u32 msg_nametype(struct tipc_msg *m) 431static inline u32 msg_nametype(struct tipc_msg *m)
@@ -863,7 +863,7 @@ void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type,
863int tipc_msg_calc_data_size(struct iovec const *msg_sect, u32 num_sect); 863int tipc_msg_calc_data_size(struct iovec const *msg_sect, u32 num_sect);
864int tipc_msg_build(struct tipc_msg *hdr, 864int tipc_msg_build(struct tipc_msg *hdr,
865 struct iovec const *msg_sect, u32 num_sect, 865 struct iovec const *msg_sect, u32 num_sect,
866 int max_size, int usrmem, struct sk_buff** buf); 866 int max_size, int usrmem, struct sk_buff **buf);
867 867
868static inline void msg_set_media_addr(struct tipc_msg *m, struct tipc_media_addr *a) 868static inline void msg_set_media_addr(struct tipc_msg *m, struct tipc_media_addr *a)
869{ 869{
@@ -872,7 +872,7 @@ static inline void msg_set_media_addr(struct tipc_msg *m, struct tipc_media_addr
872 872
873static inline void msg_get_media_addr(struct tipc_msg *m, struct tipc_media_addr *a) 873static inline void msg_get_media_addr(struct tipc_msg *m, struct tipc_media_addr *a)
874{ 874{
875 memcpy(a, &((int*)m)[5], sizeof(*a)); 875 memcpy(a, &((int *)m)[5], sizeof(*a));
876} 876}
877 877
878#endif 878#endif
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index ddc2ad4c2d32..46b2f31f96a1 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -296,8 +296,8 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
296 296
297 sseq = &nseq->sseqs[inspos]; 297 sseq = &nseq->sseqs[inspos];
298 freesseq = &nseq->sseqs[nseq->first_free]; 298 freesseq = &nseq->sseqs[nseq->first_free];
299 memmove(sseq + 1, sseq, (freesseq - sseq) * sizeof (*sseq)); 299 memmove(sseq + 1, sseq, (freesseq - sseq) * sizeof(*sseq));
300 memset(sseq, 0, sizeof (*sseq)); 300 memset(sseq, 0, sizeof(*sseq));
301 nseq->first_free++; 301 nseq->first_free++;
302 sseq->lower = lower; 302 sseq->lower = lower;
303 sseq->upper = upper; 303 sseq->upper = upper;
@@ -471,7 +471,7 @@ end_node:
471 471
472 if (!sseq->zone_list) { 472 if (!sseq->zone_list) {
473 free = &nseq->sseqs[nseq->first_free--]; 473 free = &nseq->sseqs[nseq->first_free--];
474 memmove(sseq, sseq + 1, (free - (sseq + 1)) * sizeof (*sseq)); 474 memmove(sseq, sseq + 1, (free - (sseq + 1)) * sizeof(*sseq));
475 removed_subseq = 1; 475 removed_subseq = 1;
476 } 476 }
477 477
@@ -507,7 +507,7 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq, struct subscription *s
507 507
508 while (sseq != &nseq->sseqs[nseq->first_free]) { 508 while (sseq != &nseq->sseqs[nseq->first_free]) {
509 struct publication *zl = sseq->zone_list; 509 struct publication *zl = sseq->zone_list;
510 if (zl && tipc_subscr_overlap(s,sseq->lower,sseq->upper)) { 510 if (zl && tipc_subscr_overlap(s, sseq->lower, sseq->upper)) {
511 struct publication *crs = zl; 511 struct publication *crs = zl;
512 int must_report = 1; 512 int must_report = 1;
513 513
@@ -798,7 +798,7 @@ void tipc_nametbl_subscribe(struct subscription *s)
798 if (!seq) { 798 if (!seq) {
799 seq = tipc_nameseq_create(type, &table.types[hash(type)]); 799 seq = tipc_nameseq_create(type, &table.types[hash(type)]);
800 } 800 }
801 if (seq){ 801 if (seq) {
802 spin_lock_bh(&seq->lock); 802 spin_lock_bh(&seq->lock);
803 tipc_nameseq_subscribe(seq, s); 803 tipc_nameseq_subscribe(seq, s);
804 spin_unlock_bh(&seq->lock); 804 spin_unlock_bh(&seq->lock);
@@ -819,7 +819,7 @@ void tipc_nametbl_unsubscribe(struct subscription *s)
819 819
820 write_lock_bh(&tipc_nametbl_lock); 820 write_lock_bh(&tipc_nametbl_lock);
821 seq = nametbl_find_seq(s->seq.type); 821 seq = nametbl_find_seq(s->seq.type);
822 if (seq != NULL){ 822 if (seq != NULL) {
823 spin_lock_bh(&seq->lock); 823 spin_lock_bh(&seq->lock);
824 list_del_init(&s->nameseq_list); 824 list_del_init(&s->nameseq_list);
825 spin_unlock_bh(&seq->lock); 825 spin_unlock_bh(&seq->lock);
@@ -852,7 +852,7 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
852 } 852 }
853 853
854 do { 854 do {
855 sprintf (portIdStr, "<%u.%u.%u:%u>", 855 sprintf(portIdStr, "<%u.%u.%u:%u>",
856 tipc_zone(publ->node), tipc_cluster(publ->node), 856 tipc_zone(publ->node), tipc_cluster(publ->node),
857 tipc_node(publ->node), publ->ref); 857 tipc_node(publ->node), publ->ref);
858 tipc_printf(buf, "%-26s ", portIdStr); 858 tipc_printf(buf, "%-26s ", portIdStr);
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index 139882d4ed00..d228bd682655 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -46,7 +46,7 @@ struct port_list;
46 * TIPC name types reserved for internal TIPC use (both current and planned) 46 * TIPC name types reserved for internal TIPC use (both current and planned)
47 */ 47 */
48 48
49#define TIPC_ZM_SRV 3 /* zone master service name type */ 49#define TIPC_ZM_SRV 3 /* zone master service name type */
50 50
51 51
52/** 52/**
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 126d774883dd..2ed162f91a08 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -334,7 +334,7 @@ static void node_lost_contact(struct tipc_node *n_ptr)
334 /* Clean up broadcast reception remains */ 334 /* Clean up broadcast reception remains */
335 n_ptr->bclink.gap_after = n_ptr->bclink.gap_to = 0; 335 n_ptr->bclink.gap_after = n_ptr->bclink.gap_to = 0;
336 while (n_ptr->bclink.deferred_head) { 336 while (n_ptr->bclink.deferred_head) {
337 struct sk_buff* buf = n_ptr->bclink.deferred_head; 337 struct sk_buff *buf = n_ptr->bclink.deferred_head;
338 n_ptr->bclink.deferred_head = buf->next; 338 n_ptr->bclink.deferred_head = buf->next;
339 buf_discard(buf); 339 buf_discard(buf);
340 } 340 }
diff --git a/net/tipc/port.c b/net/tipc/port.c
index db14b7e0afdc..78fcb75bb082 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -54,8 +54,8 @@ static DEFINE_SPINLOCK(queue_lock);
54 54
55static LIST_HEAD(ports); 55static LIST_HEAD(ports);
56static void port_handle_node_down(unsigned long ref); 56static void port_handle_node_down(unsigned long ref);
57static struct sk_buff* port_build_self_abort_msg(struct port *,u32 err); 57static struct sk_buff *port_build_self_abort_msg(struct port *, u32 err);
58static struct sk_buff* port_build_peer_abort_msg(struct port *,u32 err); 58static struct sk_buff *port_build_peer_abort_msg(struct port *, u32 err);
59static void port_timeout(unsigned long ref); 59static void port_timeout(unsigned long ref);
60 60
61 61
@@ -155,7 +155,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
155 155
156void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp) 156void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp)
157{ 157{
158 struct tipc_msg* msg; 158 struct tipc_msg *msg;
159 struct port_list dports = {0, NULL, }; 159 struct port_list dports = {0, NULL, };
160 struct port_list *item = dp; 160 struct port_list *item = dp;
161 int cnt = 0; 161 int cnt = 0;
@@ -193,7 +193,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp)
193 if ((index == 0) && (cnt != 0)) { 193 if ((index == 0) && (cnt != 0)) {
194 item = item->next; 194 item = item->next;
195 } 195 }
196 msg_set_destport(buf_msg(b),item->ports[index]); 196 msg_set_destport(buf_msg(b), item->ports[index]);
197 tipc_port_recv_msg(b); 197 tipc_port_recv_msg(b);
198 } 198 }
199 } 199 }
@@ -484,7 +484,7 @@ static void port_timeout(unsigned long ref)
484static void port_handle_node_down(unsigned long ref) 484static void port_handle_node_down(unsigned long ref)
485{ 485{
486 struct port *p_ptr = tipc_port_lock(ref); 486 struct port *p_ptr = tipc_port_lock(ref);
487 struct sk_buff* buf = NULL; 487 struct sk_buff *buf = NULL;
488 488
489 if (!p_ptr) 489 if (!p_ptr)
490 return; 490 return;
@@ -620,8 +620,7 @@ static void port_print(struct port *p_ptr, struct print_buf *buf, int full_id)
620 tipc_printf(buf, " via {%u,%u}", 620 tipc_printf(buf, " via {%u,%u}",
621 p_ptr->publ.conn_type, 621 p_ptr->publ.conn_type,
622 p_ptr->publ.conn_instance); 622 p_ptr->publ.conn_instance);
623 } 623 } else if (p_ptr->publ.published) {
624 else if (p_ptr->publ.published) {
625 tipc_printf(buf, " bound to"); 624 tipc_printf(buf, " bound to");
626 list_for_each_entry(publ, &p_ptr->publications, pport_list) { 625 list_for_each_entry(publ, &p_ptr->publications, pport_list) {
627 if (publ->lower == publ->upper) 626 if (publ->lower == publ->upper)
@@ -1099,7 +1098,7 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
1099 p_ptr->publ.connected = 1; 1098 p_ptr->publ.connected = 1;
1100 k_start_timer(&p_ptr->timer, p_ptr->probing_interval); 1099 k_start_timer(&p_ptr->timer, p_ptr->probing_interval);
1101 1100
1102 tipc_nodesub_subscribe(&p_ptr->subscription,peer->node, 1101 tipc_nodesub_subscribe(&p_ptr->subscription, peer->node,
1103 (void *)(unsigned long)ref, 1102 (void *)(unsigned long)ref,
1104 (net_ev_handler)port_handle_node_down); 1103 (net_ev_handler)port_handle_node_down);
1105 res = 0; 1104 res = 0;
diff --git a/net/tipc/port.h b/net/tipc/port.h
index a9c528799f2f..8e84b989949c 100644
--- a/net/tipc/port.h
+++ b/net/tipc/port.h
@@ -258,7 +258,7 @@ static inline void tipc_port_unlock(struct port *p_ptr)
258 spin_unlock_bh(p_ptr->publ.lock); 258 spin_unlock_bh(p_ptr->publ.lock);
259} 259}
260 260
261static inline struct port* tipc_port_deref(u32 ref) 261static inline struct port *tipc_port_deref(u32 ref)
262{ 262{
263 return (struct port *)tipc_ref_deref(ref); 263 return (struct port *)tipc_ref_deref(ref);
264} 264}
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index ab8ad32d8c20..3974529a66e7 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -178,14 +178,12 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock)
178 next_plus_upper = entry->ref; 178 next_plus_upper = entry->ref;
179 tipc_ref_table.first_free = next_plus_upper & index_mask; 179 tipc_ref_table.first_free = next_plus_upper & index_mask;
180 ref = (next_plus_upper & ~index_mask) + index; 180 ref = (next_plus_upper & ~index_mask) + index;
181 } 181 } else if (tipc_ref_table.init_point < tipc_ref_table.capacity) {
182 else if (tipc_ref_table.init_point < tipc_ref_table.capacity) {
183 index = tipc_ref_table.init_point++; 182 index = tipc_ref_table.init_point++;
184 entry = &(tipc_ref_table.entries[index]); 183 entry = &(tipc_ref_table.entries[index]);
185 spin_lock_init(&entry->lock); 184 spin_lock_init(&entry->lock);
186 ref = tipc_ref_table.start_mask + index; 185 ref = tipc_ref_table.start_mask + index;
187 } 186 } else {
188 else {
189 ref = 0; 187 ref = 0;
190 } 188 }
191 write_unlock_bh(&ref_table_lock); 189 write_unlock_bh(&ref_table_lock);
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 1a2eb23c6223..e9fc5df79eb0 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -375,7 +375,7 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
375 * 375 *
376 * NOTE: This routine doesn't need to take the socket lock since it only 376 * NOTE: This routine doesn't need to take the socket lock since it only
377 * accesses socket information that is unchanging (or which changes in 377 * accesses socket information that is unchanging (or which changes in
378 * a completely predictable manner). 378 * a completely predictable manner).
379 */ 379 */
380 380
381static int get_name(struct socket *sock, struct sockaddr *uaddr, 381static int get_name(struct socket *sock, struct sockaddr *uaddr,
@@ -570,14 +570,12 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
570 dest->addr.name.domain, 570 dest->addr.name.domain,
571 m->msg_iovlen, 571 m->msg_iovlen,
572 m->msg_iov); 572 m->msg_iov);
573 } 573 } else if (dest->addrtype == TIPC_ADDR_ID) {
574 else if (dest->addrtype == TIPC_ADDR_ID) {
575 res = tipc_send2port(tport->ref, 574 res = tipc_send2port(tport->ref,
576 &dest->addr.id, 575 &dest->addr.id,
577 m->msg_iovlen, 576 m->msg_iovlen,
578 m->msg_iov); 577 m->msg_iov);
579 } 578 } else if (dest->addrtype == TIPC_ADDR_MCAST) {
580 else if (dest->addrtype == TIPC_ADDR_MCAST) {
581 if (needs_conn) { 579 if (needs_conn) {
582 res = -EOPNOTSUPP; 580 res = -EOPNOTSUPP;
583 break; 581 break;
@@ -812,8 +810,8 @@ static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)
812 addr->addrtype = TIPC_ADDR_ID; 810 addr->addrtype = TIPC_ADDR_ID;
813 addr->addr.id.ref = msg_origport(msg); 811 addr->addr.id.ref = msg_origport(msg);
814 addr->addr.id.node = msg_orignode(msg); 812 addr->addr.id.node = msg_orignode(msg);
815 addr->addr.name.domain = 0; /* could leave uninitialized */ 813 addr->addr.name.domain = 0; /* could leave uninitialized */
816 addr->scope = 0; /* could leave uninitialized */ 814 addr->scope = 0; /* could leave uninitialized */
817 m->msg_namelen = sizeof(struct sockaddr_tipc); 815 m->msg_namelen = sizeof(struct sockaddr_tipc);
818 } 816 }
819} 817}
@@ -1743,10 +1741,10 @@ static int getsockopt(struct socket *sock,
1743 value = jiffies_to_msecs(tipc_sk(sk)->conn_timeout); 1741 value = jiffies_to_msecs(tipc_sk(sk)->conn_timeout);
1744 /* no need to set "res", since already 0 at this point */ 1742 /* no need to set "res", since already 0 at this point */
1745 break; 1743 break;
1746 case TIPC_NODE_RECVQ_DEPTH: 1744 case TIPC_NODE_RECVQ_DEPTH:
1747 value = (u32)atomic_read(&tipc_queue_size); 1745 value = (u32)atomic_read(&tipc_queue_size);
1748 break; 1746 break;
1749 case TIPC_SOCK_RECVQ_DEPTH: 1747 case TIPC_SOCK_RECVQ_DEPTH:
1750 value = skb_queue_len(&sk->sk_receive_queue); 1748 value = skb_queue_len(&sk->sk_receive_queue);
1751 break; 1749 break;
1752 default: 1750 default:
@@ -1772,7 +1770,7 @@ static int getsockopt(struct socket *sock,
1772 */ 1770 */
1773 1771
1774static const struct proto_ops msg_ops = { 1772static const struct proto_ops msg_ops = {
1775 .owner = THIS_MODULE, 1773 .owner = THIS_MODULE,
1776 .family = AF_TIPC, 1774 .family = AF_TIPC,
1777 .release = release, 1775 .release = release,
1778 .bind = bind, 1776 .bind = bind,
@@ -1793,7 +1791,7 @@ static const struct proto_ops msg_ops = {
1793}; 1791};
1794 1792
1795static const struct proto_ops packet_ops = { 1793static const struct proto_ops packet_ops = {
1796 .owner = THIS_MODULE, 1794 .owner = THIS_MODULE,
1797 .family = AF_TIPC, 1795 .family = AF_TIPC,
1798 .release = release, 1796 .release = release,
1799 .bind = bind, 1797 .bind = bind,
@@ -1814,7 +1812,7 @@ static const struct proto_ops packet_ops = {
1814}; 1812};
1815 1813
1816static const struct proto_ops stream_ops = { 1814static const struct proto_ops stream_ops = {
1817 .owner = THIS_MODULE, 1815 .owner = THIS_MODULE,
1818 .family = AF_TIPC, 1816 .family = AF_TIPC,
1819 .release = release, 1817 .release = release,
1820 .bind = bind, 1818 .bind = bind,
@@ -1835,7 +1833,7 @@ static const struct proto_ops stream_ops = {
1835}; 1833};
1836 1834
1837static const struct net_proto_family tipc_family_ops = { 1835static const struct net_proto_family tipc_family_ops = {
1838 .owner = THIS_MODULE, 1836 .owner = THIS_MODULE,
1839 .family = AF_TIPC, 1837 .family = AF_TIPC,
1840 .create = tipc_create 1838 .create = tipc_create
1841}; 1839};
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 510271152165..acc30e1833c9 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -538,7 +538,7 @@ int tipc_subscr_start(void)
538 struct tipc_name_seq seq = {TIPC_TOP_SRV, TIPC_TOP_SRV, TIPC_TOP_SRV}; 538 struct tipc_name_seq seq = {TIPC_TOP_SRV, TIPC_TOP_SRV, TIPC_TOP_SRV};
539 int res; 539 int res;
540 540
541 memset(&topsrv, 0, sizeof (topsrv)); 541 memset(&topsrv, 0, sizeof(topsrv));
542 spin_lock_init(&topsrv.lock); 542 spin_lock_init(&topsrv.lock);
543 INIT_LIST_HEAD(&topsrv.subscriber_list); 543 INIT_LIST_HEAD(&topsrv.subscriber_list);
544 544