diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2010-12-31 13:59:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-01 16:57:57 -0500 |
commit | a016892cd6eb8d3dd9769021b088917ac7371abd (patch) | |
tree | 7176a3754a1b26b9a4703984d7a0ccf4e320e4ee /net | |
parent | e3ec9c7d5eea9adf2c604c623c987360cc700b88 (diff) |
tipc: remove extraneous braces from single statements
Cleans up TIPC's source code to eliminate the presence of unnecessary
use of {} around single statements.
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/bcast.c | 6 | ||||
-rw-r--r-- | net/tipc/bearer.c | 3 | ||||
-rw-r--r-- | net/tipc/link.c | 25 | ||||
-rw-r--r-- | net/tipc/msg.c | 15 | ||||
-rw-r--r-- | net/tipc/name_table.c | 6 | ||||
-rw-r--r-- | net/tipc/port.c | 6 | ||||
-rw-r--r-- | net/tipc/socket.c | 14 |
7 files changed, 27 insertions, 48 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 99a1469e300a..70ab5ef48766 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -196,9 +196,8 @@ static void bclink_retransmit_pkt(u32 after, u32 to) | |||
196 | struct sk_buff *buf; | 196 | struct sk_buff *buf; |
197 | 197 | ||
198 | buf = bcl->first_out; | 198 | buf = bcl->first_out; |
199 | while (buf && less_eq(buf_seqno(buf), after)) { | 199 | while (buf && less_eq(buf_seqno(buf), after)) |
200 | buf = buf->next; | 200 | buf = buf->next; |
201 | } | ||
202 | tipc_link_retransmit(bcl, buf, mod(to - after)); | 201 | tipc_link_retransmit(bcl, buf, mod(to - after)); |
203 | } | 202 | } |
204 | 203 | ||
@@ -224,9 +223,8 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) | |||
224 | /* Skip over packets that node has previously acknowledged */ | 223 | /* Skip over packets that node has previously acknowledged */ |
225 | 224 | ||
226 | crs = bcl->first_out; | 225 | crs = bcl->first_out; |
227 | while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked)) { | 226 | while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked)) |
228 | crs = crs->next; | 227 | crs = crs->next; |
229 | } | ||
230 | 228 | ||
231 | /* Update packets that node is now acknowledging */ | 229 | /* Update packets that node is now acknowledging */ |
232 | 230 | ||
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 68e729045424..837b7a467885 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -194,9 +194,8 @@ void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) | |||
194 | unchar *addr = (unchar *)&a->dev_addr; | 194 | unchar *addr = (unchar *)&a->dev_addr; |
195 | 195 | ||
196 | tipc_printf(pb, "UNKNOWN(%u)", media_type); | 196 | tipc_printf(pb, "UNKNOWN(%u)", media_type); |
197 | for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++) { | 197 | for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++) |
198 | tipc_printf(pb, "-%02x", addr[i]); | 198 | tipc_printf(pb, "-%02x", addr[i]); |
199 | } | ||
200 | } | 199 | } |
201 | } | 200 | } |
202 | 201 | ||
diff --git a/net/tipc/link.c b/net/tipc/link.c index de9d49108d41..18702f58d111 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -615,9 +615,8 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
615 | return; /* Not yet. */ | 615 | return; /* Not yet. */ |
616 | 616 | ||
617 | if (link_blocked(l_ptr)) { | 617 | if (link_blocked(l_ptr)) { |
618 | if (event == TIMEOUT_EVT) { | 618 | if (event == TIMEOUT_EVT) |
619 | link_set_timer(l_ptr, cont_intv); | 619 | link_set_timer(l_ptr, cont_intv); |
620 | } | ||
621 | return; /* Changeover going on */ | 620 | return; /* Changeover going on */ |
622 | } | 621 | } |
623 | 622 | ||
@@ -940,11 +939,10 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) | |||
940 | if (n_ptr) { | 939 | if (n_ptr) { |
941 | tipc_node_lock(n_ptr); | 940 | tipc_node_lock(n_ptr); |
942 | l_ptr = n_ptr->active_links[selector & 1]; | 941 | l_ptr = n_ptr->active_links[selector & 1]; |
943 | if (l_ptr) { | 942 | if (l_ptr) |
944 | res = tipc_link_send_buf(l_ptr, buf); | 943 | res = tipc_link_send_buf(l_ptr, buf); |
945 | } else { | 944 | else |
946 | buf_discard(buf); | 945 | buf_discard(buf); |
947 | } | ||
948 | tipc_node_unlock(n_ptr); | 946 | tipc_node_unlock(n_ptr); |
949 | } else { | 947 | } else { |
950 | buf_discard(buf); | 948 | buf_discard(buf); |
@@ -1626,9 +1624,8 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) | |||
1626 | 1624 | ||
1627 | /* Ensure message data is a single contiguous unit */ | 1625 | /* Ensure message data is a single contiguous unit */ |
1628 | 1626 | ||
1629 | if (unlikely(buf_linearize(buf))) { | 1627 | if (unlikely(buf_linearize(buf))) |
1630 | goto cont; | 1628 | goto cont; |
1631 | } | ||
1632 | 1629 | ||
1633 | /* Handle arrival of a non-unicast link message */ | 1630 | /* Handle arrival of a non-unicast link message */ |
1634 | 1631 | ||
@@ -1843,9 +1840,8 @@ u32 tipc_link_defer_pkt(struct sk_buff **head, | |||
1843 | *head = buf; | 1840 | *head = buf; |
1844 | return 1; | 1841 | return 1; |
1845 | } | 1842 | } |
1846 | if (seq_no == msg_seqno(msg)) { | 1843 | if (seq_no == msg_seqno(msg)) |
1847 | break; | 1844 | break; |
1848 | } | ||
1849 | prev = crs; | 1845 | prev = crs; |
1850 | crs = crs->next; | 1846 | crs = crs->next; |
1851 | } while (crs); | 1847 | } while (crs); |
@@ -1959,11 +1955,10 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
1959 | msg_set_max_pkt(msg, l_ptr->max_pkt_target); | 1955 | msg_set_max_pkt(msg, l_ptr->max_pkt_target); |
1960 | } | 1956 | } |
1961 | 1957 | ||
1962 | if (tipc_node_has_redundant_links(l_ptr->owner)) { | 1958 | if (tipc_node_has_redundant_links(l_ptr->owner)) |
1963 | msg_set_redundant_link(msg); | 1959 | msg_set_redundant_link(msg); |
1964 | } else { | 1960 | else |
1965 | msg_clear_redundant_link(msg); | 1961 | msg_clear_redundant_link(msg); |
1966 | } | ||
1967 | msg_set_linkprio(msg, l_ptr->priority); | 1962 | msg_set_linkprio(msg, l_ptr->priority); |
1968 | 1963 | ||
1969 | /* Ensure sequence number will not fit : */ | 1964 | /* Ensure sequence number will not fit : */ |
@@ -2071,9 +2066,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2071 | l_ptr->peer_bearer_id = msg_bearer_id(msg); | 2066 | l_ptr->peer_bearer_id = msg_bearer_id(msg); |
2072 | 2067 | ||
2073 | /* Synchronize broadcast sequence numbers */ | 2068 | /* Synchronize broadcast sequence numbers */ |
2074 | if (!tipc_node_has_redundant_links(l_ptr->owner)) { | 2069 | if (!tipc_node_has_redundant_links(l_ptr->owner)) |
2075 | l_ptr->owner->bclink.last_in = mod(msg_last_bcast(msg)); | 2070 | l_ptr->owner->bclink.last_in = mod(msg_last_bcast(msg)); |
2076 | } | ||
2077 | break; | 2071 | break; |
2078 | case STATE_MSG: | 2072 | case STATE_MSG: |
2079 | 2073 | ||
@@ -2108,9 +2102,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2108 | max_pkt_ack = 0; | 2102 | max_pkt_ack = 0; |
2109 | if (msg_probe(msg)) { | 2103 | if (msg_probe(msg)) { |
2110 | l_ptr->stats.recv_probes++; | 2104 | l_ptr->stats.recv_probes++; |
2111 | if (msg_size(msg) > sizeof(l_ptr->proto_msg)) { | 2105 | if (msg_size(msg) > sizeof(l_ptr->proto_msg)) |
2112 | max_pkt_ack = msg_size(msg); | 2106 | max_pkt_ack = msg_size(msg); |
2113 | } | ||
2114 | } | 2107 | } |
2115 | 2108 | ||
2116 | /* Protocol message before retransmits, reduce loss risk */ | 2109 | /* Protocol message before retransmits, reduce loss risk */ |
diff --git a/net/tipc/msg.c b/net/tipc/msg.c index e81d43a8ea3d..bb6180c4fcbb 100644 --- a/net/tipc/msg.c +++ b/net/tipc/msg.c | |||
@@ -348,7 +348,8 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str) | |||
348 | tipc_printf(buf, "UNKNOWN ERROR(%x):", | 348 | tipc_printf(buf, "UNKNOWN ERROR(%x):", |
349 | msg_errcode(msg)); | 349 | msg_errcode(msg)); |
350 | } | 350 | } |
351 | default:{} | 351 | default: |
352 | break; | ||
352 | } | 353 | } |
353 | 354 | ||
354 | tipc_printf(buf, "HZ(%u):", msg_hdr_sz(msg)); | 355 | tipc_printf(buf, "HZ(%u):", msg_hdr_sz(msg)); |
@@ -357,9 +358,8 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str) | |||
357 | 358 | ||
358 | if (msg_non_seq(msg)) | 359 | if (msg_non_seq(msg)) |
359 | tipc_printf(buf, "NOSEQ:"); | 360 | tipc_printf(buf, "NOSEQ:"); |
360 | else { | 361 | else |
361 | tipc_printf(buf, "ACK(%u):", msg_ack(msg)); | 362 | tipc_printf(buf, "ACK(%u):", msg_ack(msg)); |
362 | } | ||
363 | tipc_printf(buf, "BACK(%u):", msg_bcast_ack(msg)); | 363 | tipc_printf(buf, "BACK(%u):", msg_bcast_ack(msg)); |
364 | tipc_printf(buf, "PRND(%x)", msg_prevnode(msg)); | 364 | tipc_printf(buf, "PRND(%x)", msg_prevnode(msg)); |
365 | 365 | ||
@@ -387,9 +387,8 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str) | |||
387 | if (msg_user(msg) == NAME_DISTRIBUTOR) { | 387 | if (msg_user(msg) == NAME_DISTRIBUTOR) { |
388 | tipc_printf(buf, ":ONOD(%x):", msg_orignode(msg)); | 388 | tipc_printf(buf, ":ONOD(%x):", msg_orignode(msg)); |
389 | tipc_printf(buf, ":DNOD(%x):", msg_destnode(msg)); | 389 | tipc_printf(buf, ":DNOD(%x):", msg_destnode(msg)); |
390 | if (msg_routed(msg)) { | 390 | if (msg_routed(msg)) |
391 | tipc_printf(buf, ":CSEQN(%u)", msg_transp_seqno(msg)); | 391 | tipc_printf(buf, ":CSEQN(%u)", msg_transp_seqno(msg)); |
392 | } | ||
393 | } | 392 | } |
394 | 393 | ||
395 | if (msg_user(msg) == LINK_CONFIG) { | 394 | if (msg_user(msg) == LINK_CONFIG) { |
@@ -405,12 +404,10 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str) | |||
405 | tipc_printf(buf, "TO(%u):", msg_bcgap_to(msg)); | 404 | tipc_printf(buf, "TO(%u):", msg_bcgap_to(msg)); |
406 | } | 405 | } |
407 | tipc_printf(buf, "\n"); | 406 | tipc_printf(buf, "\n"); |
408 | if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg))) { | 407 | if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg))) |
409 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); | 408 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); |
410 | } | 409 | if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT)) |
411 | if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT)) { | ||
412 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); | 410 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); |
413 | } | ||
414 | } | 411 | } |
415 | 412 | ||
416 | #endif | 413 | #endif |
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index ea3e94e9d939..205ed4a4e186 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -751,9 +751,8 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper, | |||
751 | table.local_publ_count++; | 751 | table.local_publ_count++; |
752 | publ = tipc_nametbl_insert_publ(type, lower, upper, scope, | 752 | publ = tipc_nametbl_insert_publ(type, lower, upper, scope, |
753 | tipc_own_addr, port_ref, key); | 753 | tipc_own_addr, port_ref, key); |
754 | if (publ && (scope != TIPC_NODE_SCOPE)) { | 754 | if (publ && (scope != TIPC_NODE_SCOPE)) |
755 | tipc_named_publish(publ); | 755 | tipc_named_publish(publ); |
756 | } | ||
757 | write_unlock_bh(&tipc_nametbl_lock); | 756 | write_unlock_bh(&tipc_nametbl_lock); |
758 | return publ; | 757 | return publ; |
759 | } | 758 | } |
@@ -795,9 +794,8 @@ void tipc_nametbl_subscribe(struct subscription *s) | |||
795 | 794 | ||
796 | write_lock_bh(&tipc_nametbl_lock); | 795 | write_lock_bh(&tipc_nametbl_lock); |
797 | seq = nametbl_find_seq(type); | 796 | seq = nametbl_find_seq(type); |
798 | if (!seq) { | 797 | if (!seq) |
799 | seq = tipc_nameseq_create(type, &table.types[hash(type)]); | 798 | seq = tipc_nameseq_create(type, &table.types[hash(type)]); |
800 | } | ||
801 | if (seq) { | 799 | if (seq) { |
802 | spin_lock_bh(&seq->lock); | 800 | spin_lock_bh(&seq->lock); |
803 | tipc_nameseq_subscribe(seq, s); | 801 | tipc_nameseq_subscribe(seq, s); |
diff --git a/net/tipc/port.c b/net/tipc/port.c index c23f3380d0a7..067bab2a0b98 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -131,9 +131,8 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, | |||
131 | } | 131 | } |
132 | } | 132 | } |
133 | res = tipc_bclink_send_msg(buf); | 133 | res = tipc_bclink_send_msg(buf); |
134 | if ((res < 0) && (dports.count != 0)) { | 134 | if ((res < 0) && (dports.count != 0)) |
135 | buf_discard(ibuf); | 135 | buf_discard(ibuf); |
136 | } | ||
137 | } else { | 136 | } else { |
138 | ibuf = buf; | 137 | ibuf = buf; |
139 | } | 138 | } |
@@ -190,9 +189,8 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp) | |||
190 | warn("Unable to deliver multicast message(s)\n"); | 189 | warn("Unable to deliver multicast message(s)\n"); |
191 | goto exit; | 190 | goto exit; |
192 | } | 191 | } |
193 | if ((index == 0) && (cnt != 0)) { | 192 | if ((index == 0) && (cnt != 0)) |
194 | item = item->next; | 193 | item = item->next; |
195 | } | ||
196 | msg_set_destport(buf_msg(b), item->ports[index]); | 194 | msg_set_destport(buf_msg(b), item->ports[index]); |
197 | tipc_port_recv_msg(b); | 195 | tipc_port_recv_msg(b); |
198 | } | 196 | } |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 18aad573f551..2b02a3a80313 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -590,9 +590,8 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, | |||
590 | m->msg_iov); | 590 | m->msg_iov); |
591 | } | 591 | } |
592 | if (likely(res != -ELINKCONG)) { | 592 | if (likely(res != -ELINKCONG)) { |
593 | if (needs_conn && (res >= 0)) { | 593 | if (needs_conn && (res >= 0)) |
594 | sock->state = SS_CONNECTING; | 594 | sock->state = SS_CONNECTING; |
595 | } | ||
596 | break; | 595 | break; |
597 | } | 596 | } |
598 | if (m->msg_flags & MSG_DONTWAIT) { | 597 | if (m->msg_flags & MSG_DONTWAIT) { |
@@ -651,9 +650,8 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, | |||
651 | } | 650 | } |
652 | 651 | ||
653 | res = tipc_send(tport->ref, m->msg_iovlen, m->msg_iov); | 652 | res = tipc_send(tport->ref, m->msg_iovlen, m->msg_iov); |
654 | if (likely(res != -ELINKCONG)) { | 653 | if (likely(res != -ELINKCONG)) |
655 | break; | 654 | break; |
656 | } | ||
657 | if (m->msg_flags & MSG_DONTWAIT) { | 655 | if (m->msg_flags & MSG_DONTWAIT) { |
658 | res = -EWOULDBLOCK; | 656 | res = -EWOULDBLOCK; |
659 | break; | 657 | break; |
@@ -1418,9 +1416,8 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, | |||
1418 | m.msg_name = dest; | 1416 | m.msg_name = dest; |
1419 | m.msg_namelen = destlen; | 1417 | m.msg_namelen = destlen; |
1420 | res = send_msg(NULL, sock, &m, 0); | 1418 | res = send_msg(NULL, sock, &m, 0); |
1421 | if (res < 0) { | 1419 | if (res < 0) |
1422 | goto exit; | 1420 | goto exit; |
1423 | } | ||
1424 | 1421 | ||
1425 | /* Wait until an 'ACK' or 'RST' arrives, or a timeout occurs */ | 1422 | /* Wait until an 'ACK' or 'RST' arrives, or a timeout occurs */ |
1426 | 1423 | ||
@@ -1442,11 +1439,10 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, | |||
1442 | advance_rx_queue(sk); | 1439 | advance_rx_queue(sk); |
1443 | } | 1440 | } |
1444 | } else { | 1441 | } else { |
1445 | if (sock->state == SS_CONNECTED) { | 1442 | if (sock->state == SS_CONNECTED) |
1446 | res = -EISCONN; | 1443 | res = -EISCONN; |
1447 | } else { | 1444 | else |
1448 | res = -ECONNREFUSED; | 1445 | res = -ECONNREFUSED; |
1449 | } | ||
1450 | } | 1446 | } |
1451 | } else { | 1447 | } else { |
1452 | if (res == 0) | 1448 | if (res == 0) |