diff options
Diffstat (limited to 'net/tipc')
| -rw-r--r-- | net/tipc/addr.c | 2 | ||||
| -rw-r--r-- | net/tipc/bcast.c | 2 | ||||
| -rw-r--r-- | net/tipc/bearer.c | 2 | ||||
| -rw-r--r-- | net/tipc/dbg.c | 4 | ||||
| -rw-r--r-- | net/tipc/link.c | 6 | ||||
| -rw-r--r-- | net/tipc/link.h | 16 | ||||
| -rw-r--r-- | net/tipc/msg.h | 6 | ||||
| -rw-r--r-- | net/tipc/name_table.c | 2 | ||||
| -rw-r--r-- | net/tipc/node.c | 6 | ||||
| -rw-r--r-- | net/tipc/port.h | 2 | ||||
| -rw-r--r-- | net/tipc/socket.c | 2 | ||||
| -rw-r--r-- | net/tipc/subscr.c | 2 |
12 files changed, 26 insertions, 26 deletions
diff --git a/net/tipc/addr.c b/net/tipc/addr.c index c048543ffbeb..2ddc351b3be9 100644 --- a/net/tipc/addr.c +++ b/net/tipc/addr.c | |||
| @@ -89,7 +89,7 @@ int tipc_addr_domain_valid(u32 addr) | |||
| 89 | 89 | ||
| 90 | int tipc_addr_node_valid(u32 addr) | 90 | int tipc_addr_node_valid(u32 addr) |
| 91 | { | 91 | { |
| 92 | return (tipc_addr_domain_valid(addr) && tipc_node(addr)); | 92 | return tipc_addr_domain_valid(addr) && tipc_node(addr); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | int tipc_in_scope(u32 domain, u32 addr) | 95 | int tipc_in_scope(u32 domain, u32 addr) |
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index b11248c2d788..ecfaac10d0b4 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
| @@ -184,7 +184,7 @@ static void bclink_set_gap(struct tipc_node *n_ptr) | |||
| 184 | 184 | ||
| 185 | static int bclink_ack_allowed(u32 n) | 185 | static int bclink_ack_allowed(u32 n) |
| 186 | { | 186 | { |
| 187 | return((n % TIPC_MIN_LINK_WIN) == tipc_own_tag); | 187 | return (n % TIPC_MIN_LINK_WIN) == tipc_own_tag; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | 190 | ||
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 52ae17b2583e..9c10c6b7c12b 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
| @@ -63,7 +63,7 @@ static int media_name_valid(const char *name) | |||
| 63 | len = strlen(name); | 63 | len = strlen(name); |
| 64 | if ((len + 1) > TIPC_MAX_MEDIA_NAME) | 64 | if ((len + 1) > TIPC_MAX_MEDIA_NAME) |
| 65 | return 0; | 65 | return 0; |
| 66 | return (strspn(name, tipc_alphabet) == len); | 66 | return strspn(name, tipc_alphabet) == len; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
diff --git a/net/tipc/dbg.c b/net/tipc/dbg.c index 1885a7edb0c8..6569d45bfb9a 100644 --- a/net/tipc/dbg.c +++ b/net/tipc/dbg.c | |||
| @@ -134,7 +134,7 @@ void tipc_printbuf_reset(struct print_buf *pb) | |||
| 134 | 134 | ||
| 135 | int tipc_printbuf_empty(struct print_buf *pb) | 135 | int tipc_printbuf_empty(struct print_buf *pb) |
| 136 | { | 136 | { |
| 137 | return (!pb->buf || (pb->crs == pb->buf)); | 137 | return !pb->buf || (pb->crs == pb->buf); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | /** | 140 | /** |
| @@ -169,7 +169,7 @@ int tipc_printbuf_validate(struct print_buf *pb) | |||
| 169 | tipc_printf(pb, err); | 169 | tipc_printf(pb, err); |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | return (pb->crs - pb->buf + 1); | 172 | return pb->crs - pb->buf + 1; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | /** | 175 | /** |
diff --git a/net/tipc/link.c b/net/tipc/link.c index a6a3102bb4d6..b8cf1e9d0b86 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
| @@ -239,13 +239,13 @@ int tipc_link_is_up(struct link *l_ptr) | |||
| 239 | { | 239 | { |
| 240 | if (!l_ptr) | 240 | if (!l_ptr) |
| 241 | return 0; | 241 | return 0; |
| 242 | return (link_working_working(l_ptr) || link_working_unknown(l_ptr)); | 242 | return link_working_working(l_ptr) || link_working_unknown(l_ptr); |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | int tipc_link_is_active(struct link *l_ptr) | 245 | int tipc_link_is_active(struct link *l_ptr) |
| 246 | { | 246 | { |
| 247 | return ((l_ptr->owner->active_links[0] == l_ptr) || | 247 | return (l_ptr->owner->active_links[0] == l_ptr) || |
| 248 | (l_ptr->owner->active_links[1] == l_ptr)); | 248 | (l_ptr->owner->active_links[1] == l_ptr); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | /** | 251 | /** |
diff --git a/net/tipc/link.h b/net/tipc/link.h index 2e5385c47d30..26151d30589d 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
| @@ -279,12 +279,12 @@ static inline int between(u32 lower, u32 upper, u32 n) | |||
| 279 | 279 | ||
| 280 | static inline int less_eq(u32 left, u32 right) | 280 | static inline int less_eq(u32 left, u32 right) |
| 281 | { | 281 | { |
| 282 | return (mod(right - left) < 32768u); | 282 | return mod(right - left) < 32768u; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static inline int less(u32 left, u32 right) | 285 | static inline int less(u32 left, u32 right) |
| 286 | { | 286 | { |
| 287 | return (less_eq(left, right) && (mod(right) != mod(left))); | 287 | return less_eq(left, right) && (mod(right) != mod(left)); |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | static inline u32 lesser(u32 left, u32 right) | 290 | static inline u32 lesser(u32 left, u32 right) |
| @@ -299,32 +299,32 @@ static inline u32 lesser(u32 left, u32 right) | |||
| 299 | 299 | ||
| 300 | static inline int link_working_working(struct link *l_ptr) | 300 | static inline int link_working_working(struct link *l_ptr) |
| 301 | { | 301 | { |
| 302 | return (l_ptr->state == WORKING_WORKING); | 302 | return l_ptr->state == WORKING_WORKING; |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | static inline int link_working_unknown(struct link *l_ptr) | 305 | static inline int link_working_unknown(struct link *l_ptr) |
| 306 | { | 306 | { |
| 307 | return (l_ptr->state == WORKING_UNKNOWN); | 307 | return l_ptr->state == WORKING_UNKNOWN; |
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | static inline int link_reset_unknown(struct link *l_ptr) | 310 | static inline int link_reset_unknown(struct link *l_ptr) |
| 311 | { | 311 | { |
| 312 | return (l_ptr->state == RESET_UNKNOWN); | 312 | return l_ptr->state == RESET_UNKNOWN; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | static inline int link_reset_reset(struct link *l_ptr) | 315 | static inline int link_reset_reset(struct link *l_ptr) |
| 316 | { | 316 | { |
| 317 | return (l_ptr->state == RESET_RESET); | 317 | return l_ptr->state == RESET_RESET; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | static inline int link_blocked(struct link *l_ptr) | 320 | static inline int link_blocked(struct link *l_ptr) |
| 321 | { | 321 | { |
| 322 | return (l_ptr->exp_msg_count || l_ptr->blocked); | 322 | return l_ptr->exp_msg_count || l_ptr->blocked; |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | static inline int link_congested(struct link *l_ptr) | 325 | static inline int link_congested(struct link *l_ptr) |
| 326 | { | 326 | { |
| 327 | return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]); | 327 | return l_ptr->out_queue_size >= l_ptr->queue_limit[0]; |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | #endif | 330 | #endif |
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index 995d2da35b01..031aad18efce 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h | |||
| @@ -104,7 +104,7 @@ static inline u32 msg_user(struct tipc_msg *m) | |||
| 104 | 104 | ||
| 105 | static inline u32 msg_isdata(struct tipc_msg *m) | 105 | static inline u32 msg_isdata(struct tipc_msg *m) |
| 106 | { | 106 | { |
| 107 | return (msg_user(m) <= TIPC_CRITICAL_IMPORTANCE); | 107 | return msg_user(m) <= TIPC_CRITICAL_IMPORTANCE; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static inline void msg_set_user(struct tipc_msg *m, u32 n) | 110 | static inline void msg_set_user(struct tipc_msg *m, u32 n) |
| @@ -289,7 +289,7 @@ static inline void msg_set_destnode(struct tipc_msg *m, u32 a) | |||
| 289 | 289 | ||
| 290 | static inline int msg_is_dest(struct tipc_msg *m, u32 d) | 290 | static inline int msg_is_dest(struct tipc_msg *m, u32 d) |
| 291 | { | 291 | { |
| 292 | return(msg_short(m) || (msg_destnode(m) == d)); | 292 | return msg_short(m) || (msg_destnode(m) == d); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static inline u32 msg_routed(struct tipc_msg *m) | 295 | static inline u32 msg_routed(struct tipc_msg *m) |
| @@ -632,7 +632,7 @@ static inline void msg_set_bcast_tag(struct tipc_msg *m, u32 n) | |||
| 632 | 632 | ||
| 633 | static inline u32 msg_max_pkt(struct tipc_msg *m) | 633 | static inline u32 msg_max_pkt(struct tipc_msg *m) |
| 634 | { | 634 | { |
| 635 | return (msg_bits(m, 9, 16, 0xffff) * 4); | 635 | return msg_bits(m, 9, 16, 0xffff) * 4; |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | static inline void msg_set_max_pkt(struct tipc_msg *m, u32 n) | 638 | static inline void msg_set_max_pkt(struct tipc_msg *m, u32 n) |
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index c13c2c7c4b57..9ca4b0689237 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
| @@ -116,7 +116,7 @@ DEFINE_RWLOCK(tipc_nametbl_lock); | |||
| 116 | 116 | ||
| 117 | static int hash(int x) | 117 | static int hash(int x) |
| 118 | { | 118 | { |
| 119 | return(x & (tipc_nametbl_size - 1)); | 119 | return x & (tipc_nametbl_size - 1); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | /** | 122 | /** |
diff --git a/net/tipc/node.c b/net/tipc/node.c index b702c7bf580f..7c49cd056df7 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
| @@ -242,17 +242,17 @@ int tipc_node_has_active_links(struct tipc_node *n_ptr) | |||
| 242 | 242 | ||
| 243 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr) | 243 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr) |
| 244 | { | 244 | { |
| 245 | return (n_ptr->working_links > 1); | 245 | return n_ptr->working_links > 1; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static int tipc_node_has_active_routes(struct tipc_node *n_ptr) | 248 | static int tipc_node_has_active_routes(struct tipc_node *n_ptr) |
| 249 | { | 249 | { |
| 250 | return (n_ptr && (n_ptr->last_router >= 0)); | 250 | return n_ptr && (n_ptr->last_router >= 0); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | int tipc_node_is_up(struct tipc_node *n_ptr) | 253 | int tipc_node_is_up(struct tipc_node *n_ptr) |
| 254 | { | 254 | { |
| 255 | return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); | 255 | return tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr) | 258 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr) |
diff --git a/net/tipc/port.h b/net/tipc/port.h index 8d1652aab298..e74bd9563739 100644 --- a/net/tipc/port.h +++ b/net/tipc/port.h | |||
| @@ -157,7 +157,7 @@ static inline u32 tipc_peer_node(struct port *p_ptr) | |||
| 157 | 157 | ||
| 158 | static inline int tipc_port_congested(struct port *p_ptr) | 158 | static inline int tipc_port_congested(struct port *p_ptr) |
| 159 | { | 159 | { |
| 160 | return((p_ptr->sent - p_ptr->acked) >= (TIPC_FLOW_CONTROL_WIN * 2)); | 160 | return (p_ptr->sent - p_ptr->acked) >= (TIPC_FLOW_CONTROL_WIN * 2); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | /** | 163 | /** |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index f7ac94de24fe..33217fc3d697 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -1195,7 +1195,7 @@ static int rx_queue_full(struct tipc_msg *msg, u32 queue_size, u32 base) | |||
| 1195 | if (msg_connected(msg)) | 1195 | if (msg_connected(msg)) |
| 1196 | threshold *= 4; | 1196 | threshold *= 4; |
| 1197 | 1197 | ||
| 1198 | return (queue_size >= threshold); | 1198 | return queue_size >= threshold; |
| 1199 | } | 1199 | } |
| 1200 | 1200 | ||
| 1201 | /** | 1201 | /** |
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index ab6eab4c45e2..1a5b9a6bd128 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
| @@ -604,6 +604,6 @@ int tipc_ispublished(struct tipc_name const *name) | |||
| 604 | { | 604 | { |
| 605 | u32 domain = 0; | 605 | u32 domain = 0; |
| 606 | 606 | ||
| 607 | return(tipc_nametbl_translate(name->type, name->instance,&domain) != 0); | 607 | return tipc_nametbl_translate(name->type, name->instance, &domain) != 0; |
| 608 | } | 608 | } |
| 609 | 609 | ||
