aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2008-07-15 01:44:01 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-15 01:44:01 -0400
commit0e35fd5e5264bb46d1febbe9cd9aa08421c21a96 (patch)
tree984ea14bf1e691d02b3202abeff087ba4369bc44
parent2da59918e26837f305131cfac9c0f1b3b42bb8ae (diff)
tipc: Eliminate improper use of TIPC_OK error code
This patch corrects many places where TIPC routines indicated successful completion by returning TIPC_OK instead of 0. (The TIPC_OK symbol has the value 0, but it should only be used in contexts that deal with the error code field of a TIPC message header.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/bcast.c10
-rw-r--r--net/tipc/bearer.c8
-rw-r--r--net/tipc/cluster.c2
-rw-r--r--net/tipc/eth_media.c6
-rw-r--r--net/tipc/link.c18
-rw-r--r--net/tipc/net.c4
-rw-r--r--net/tipc/port.c34
-rw-r--r--net/tipc/ref.c2
-rw-r--r--net/tipc/user_reg.c14
9 files changed, 49 insertions, 49 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a5883b1452ff..b1ff16aa4bdb 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -611,7 +611,7 @@ swap:
611 bcbearer->bpairs[bp_index].secondary = p; 611 bcbearer->bpairs[bp_index].secondary = p;
612update: 612update:
613 if (bcbearer->remains_new.count == 0) 613 if (bcbearer->remains_new.count == 0)
614 return TIPC_OK; 614 return 0;
615 615
616 bcbearer->remains = bcbearer->remains_new; 616 bcbearer->remains = bcbearer->remains_new;
617 } 617 }
@@ -620,7 +620,7 @@ update:
620 620
621 bcbearer->bearer.publ.blocked = 1; 621 bcbearer->bearer.publ.blocked = 1;
622 bcl->stats.bearer_congs++; 622 bcl->stats.bearer_congs++;
623 return ~TIPC_OK; 623 return 1;
624} 624}
625 625
626/** 626/**
@@ -756,7 +756,7 @@ int tipc_bclink_reset_stats(void)
756 spin_lock_bh(&bc_lock); 756 spin_lock_bh(&bc_lock);
757 memset(&bcl->stats, 0, sizeof(bcl->stats)); 757 memset(&bcl->stats, 0, sizeof(bcl->stats));
758 spin_unlock_bh(&bc_lock); 758 spin_unlock_bh(&bc_lock);
759 return TIPC_OK; 759 return 0;
760} 760}
761 761
762int tipc_bclink_set_queue_limits(u32 limit) 762int tipc_bclink_set_queue_limits(u32 limit)
@@ -769,7 +769,7 @@ int tipc_bclink_set_queue_limits(u32 limit)
769 spin_lock_bh(&bc_lock); 769 spin_lock_bh(&bc_lock);
770 tipc_link_set_queue_limits(bcl, limit); 770 tipc_link_set_queue_limits(bcl, limit);
771 spin_unlock_bh(&bc_lock); 771 spin_unlock_bh(&bc_lock);
772 return TIPC_OK; 772 return 0;
773} 773}
774 774
775int tipc_bclink_init(void) 775int tipc_bclink_init(void)
@@ -810,7 +810,7 @@ int tipc_bclink_init(void)
810 tipc_printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE); 810 tipc_printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE);
811 } 811 }
812 812
813 return TIPC_OK; 813 return 0;
814} 814}
815 815
816void tipc_bclink_stop(void) 816void tipc_bclink_stop(void)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 271a375b49b7..6a9aba3edd08 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -370,7 +370,7 @@ void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest)
370 */ 370 */
371static int bearer_push(struct bearer *b_ptr) 371static int bearer_push(struct bearer *b_ptr)
372{ 372{
373 u32 res = TIPC_OK; 373 u32 res = 0;
374 struct link *ln, *tln; 374 struct link *ln, *tln;
375 375
376 if (b_ptr->publ.blocked) 376 if (b_ptr->publ.blocked)
@@ -607,7 +607,7 @@ int tipc_block_bearer(const char *name)
607 } 607 }
608 spin_unlock_bh(&b_ptr->publ.lock); 608 spin_unlock_bh(&b_ptr->publ.lock);
609 read_unlock_bh(&tipc_net_lock); 609 read_unlock_bh(&tipc_net_lock);
610 return TIPC_OK; 610 return 0;
611} 611}
612 612
613/** 613/**
@@ -645,7 +645,7 @@ static int bearer_disable(const char *name)
645 } 645 }
646 spin_unlock_bh(&b_ptr->publ.lock); 646 spin_unlock_bh(&b_ptr->publ.lock);
647 memset(b_ptr, 0, sizeof(struct bearer)); 647 memset(b_ptr, 0, sizeof(struct bearer));
648 return TIPC_OK; 648 return 0;
649} 649}
650 650
651int tipc_disable_bearer(const char *name) 651int tipc_disable_bearer(const char *name)
@@ -668,7 +668,7 @@ int tipc_bearer_init(void)
668 tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC); 668 tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
669 media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC); 669 media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
670 if (tipc_bearers && media_list) { 670 if (tipc_bearers && media_list) {
671 res = TIPC_OK; 671 res = 0;
672 } else { 672 } else {
673 kfree(tipc_bearers); 673 kfree(tipc_bearers);
674 kfree(media_list); 674 kfree(media_list);
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index bc1db474fe01..46ee6c58532d 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -571,6 +571,6 @@ exit:
571int tipc_cltr_init(void) 571int tipc_cltr_init(void)
572{ 572{
573 tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves; 573 tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves;
574 return tipc_cltr_create(tipc_own_addr) ? TIPC_OK : -ENOMEM; 574 return tipc_cltr_create(tipc_own_addr) ? 0 : -ENOMEM;
575} 575}
576 576
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 9cd35eec3e7f..bc72fbc4f8b8 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -82,7 +82,7 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr,
82 dev->dev_addr, clone->len); 82 dev->dev_addr, clone->len);
83 dev_queue_xmit(clone); 83 dev_queue_xmit(clone);
84 } 84 }
85 return TIPC_OK; 85 return 0;
86} 86}
87 87
88/** 88/**
@@ -113,12 +113,12 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
113 if (likely(buf->len == size)) { 113 if (likely(buf->len == size)) {
114 buf->next = NULL; 114 buf->next = NULL;
115 tipc_recv_msg(buf, eb_ptr->bearer); 115 tipc_recv_msg(buf, eb_ptr->bearer);
116 return TIPC_OK; 116 return 0;
117 } 117 }
118 } 118 }
119 } 119 }
120 kfree_skb(buf); 120 kfree_skb(buf);
121 return TIPC_OK; 121 return 0;
122} 122}
123 123
124/** 124/**
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 9784a8e963b4..d60113ba4b1b 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1561,7 +1561,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1561 l_ptr->retransm_queue_head = mod(++r_q_head); 1561 l_ptr->retransm_queue_head = mod(++r_q_head);
1562 l_ptr->retransm_queue_size = --r_q_size; 1562 l_ptr->retransm_queue_size = --r_q_size;
1563 l_ptr->stats.retransmitted++; 1563 l_ptr->stats.retransmitted++;
1564 return TIPC_OK; 1564 return 0;
1565 } else { 1565 } else {
1566 l_ptr->stats.bearer_congs++; 1566 l_ptr->stats.bearer_congs++;
1567 msg_dbg(buf_msg(buf), "|>DEF-RETR>"); 1567 msg_dbg(buf_msg(buf), "|>DEF-RETR>");
@@ -1580,7 +1580,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1580 l_ptr->unacked_window = 0; 1580 l_ptr->unacked_window = 0;
1581 buf_discard(buf); 1581 buf_discard(buf);
1582 l_ptr->proto_msg_queue = NULL; 1582 l_ptr->proto_msg_queue = NULL;
1583 return TIPC_OK; 1583 return 0;
1584 } else { 1584 } else {
1585 msg_dbg(buf_msg(buf), "|>DEF-PROT>"); 1585 msg_dbg(buf_msg(buf), "|>DEF-PROT>");
1586 l_ptr->stats.bearer_congs++; 1586 l_ptr->stats.bearer_congs++;
@@ -1604,7 +1604,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1604 msg_set_type(msg, CLOSED_MSG); 1604 msg_set_type(msg, CLOSED_MSG);
1605 msg_dbg(msg, ">PUSH-DATA>"); 1605 msg_dbg(msg, ">PUSH-DATA>");
1606 l_ptr->next_out = buf->next; 1606 l_ptr->next_out = buf->next;
1607 return TIPC_OK; 1607 return 0;
1608 } else { 1608 } else {
1609 msg_dbg(msg, "|PUSH-DATA|"); 1609 msg_dbg(msg, "|PUSH-DATA|");
1610 l_ptr->stats.bearer_congs++; 1610 l_ptr->stats.bearer_congs++;
@@ -1628,8 +1628,8 @@ void tipc_link_push_queue(struct link *l_ptr)
1628 1628
1629 do { 1629 do {
1630 res = tipc_link_push_packet(l_ptr); 1630 res = tipc_link_push_packet(l_ptr);
1631 } 1631 } while (!res);
1632 while (res == TIPC_OK); 1632
1633 if (res == PUSH_FAILED) 1633 if (res == PUSH_FAILED)
1634 tipc_bearer_schedule(l_ptr->b_ptr, l_ptr); 1634 tipc_bearer_schedule(l_ptr->b_ptr, l_ptr);
1635} 1635}
@@ -2998,7 +2998,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
2998 link_set_supervision_props(l_ptr, new_value); 2998 link_set_supervision_props(l_ptr, new_value);
2999 tipc_link_send_proto_msg(l_ptr, STATE_MSG, 2999 tipc_link_send_proto_msg(l_ptr, STATE_MSG,
3000 0, 0, new_value, 0, 0); 3000 0, 0, new_value, 0, 0);
3001 res = TIPC_OK; 3001 res = 0;
3002 } 3002 }
3003 break; 3003 break;
3004 case TIPC_CMD_SET_LINK_PRI: 3004 case TIPC_CMD_SET_LINK_PRI:
@@ -3007,14 +3007,14 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
3007 l_ptr->priority = new_value; 3007 l_ptr->priority = new_value;
3008 tipc_link_send_proto_msg(l_ptr, STATE_MSG, 3008 tipc_link_send_proto_msg(l_ptr, STATE_MSG,
3009 0, 0, 0, new_value, 0); 3009 0, 0, 0, new_value, 0);
3010 res = TIPC_OK; 3010 res = 0;
3011 } 3011 }
3012 break; 3012 break;
3013 case TIPC_CMD_SET_LINK_WINDOW: 3013 case TIPC_CMD_SET_LINK_WINDOW:
3014 if ((new_value >= TIPC_MIN_LINK_WIN) && 3014 if ((new_value >= TIPC_MIN_LINK_WIN) &&
3015 (new_value <= TIPC_MAX_LINK_WIN)) { 3015 (new_value <= TIPC_MAX_LINK_WIN)) {
3016 tipc_link_set_queue_limits(l_ptr, new_value); 3016 tipc_link_set_queue_limits(l_ptr, new_value);
3017 res = TIPC_OK; 3017 res = 0;
3018 } 3018 }
3019 break; 3019 break;
3020 } 3020 }
@@ -3230,7 +3230,7 @@ int link_control(const char *name, u32 op, u32 val)
3230 if (op == TIPC_CMD_UNBLOCK_LINK) { 3230 if (op == TIPC_CMD_UNBLOCK_LINK) {
3231 l_ptr->blocked = 0; 3231 l_ptr->blocked = 0;
3232 } 3232 }
3233 res = TIPC_OK; 3233 res = 0;
3234 } 3234 }
3235 tipc_node_unlock(node); 3235 tipc_node_unlock(node);
3236 } 3236 }
diff --git a/net/tipc/net.c b/net/tipc/net.c
index cc51fa483672..ec7b04fbdc43 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -165,7 +165,7 @@ static int net_init(void)
165 if (!tipc_net.zones) { 165 if (!tipc_net.zones) {
166 return -ENOMEM; 166 return -ENOMEM;
167 } 167 }
168 return TIPC_OK; 168 return 0;
169} 169}
170 170
171static void net_stop(void) 171static void net_stop(void)
@@ -295,7 +295,7 @@ int tipc_net_start(u32 addr)
295 info("Started in network mode\n"); 295 info("Started in network mode\n");
296 info("Own node address %s, network identity %u\n", 296 info("Own node address %s, network identity %u\n",
297 addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); 297 addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
298 return TIPC_OK; 298 return 0;
299} 299}
300 300
301void tipc_net_stop(void) 301void tipc_net_stop(void)
diff --git a/net/tipc/port.c b/net/tipc/port.c
index ffba1e7f06d2..e70d27ea6578 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -291,7 +291,7 @@ int tipc_deleteport(u32 ref)
291 kfree(p_ptr); 291 kfree(p_ptr);
292 dbg("Deleted port %u\n", ref); 292 dbg("Deleted port %u\n", ref);
293 tipc_net_route_msg(buf); 293 tipc_net_route_msg(buf);
294 return TIPC_OK; 294 return 0;
295} 295}
296 296
297/** 297/**
@@ -336,7 +336,7 @@ int tipc_portunreliable(u32 ref, unsigned int *isunreliable)
336 return -EINVAL; 336 return -EINVAL;
337 *isunreliable = port_unreliable(p_ptr); 337 *isunreliable = port_unreliable(p_ptr);
338 tipc_port_unlock(p_ptr); 338 tipc_port_unlock(p_ptr);
339 return TIPC_OK; 339 return 0;
340} 340}
341 341
342int tipc_set_portunreliable(u32 ref, unsigned int isunreliable) 342int tipc_set_portunreliable(u32 ref, unsigned int isunreliable)
@@ -348,7 +348,7 @@ int tipc_set_portunreliable(u32 ref, unsigned int isunreliable)
348 return -EINVAL; 348 return -EINVAL;
349 msg_set_src_droppable(&p_ptr->publ.phdr, (isunreliable != 0)); 349 msg_set_src_droppable(&p_ptr->publ.phdr, (isunreliable != 0));
350 tipc_port_unlock(p_ptr); 350 tipc_port_unlock(p_ptr);
351 return TIPC_OK; 351 return 0;
352} 352}
353 353
354static int port_unreturnable(struct port *p_ptr) 354static int port_unreturnable(struct port *p_ptr)
@@ -365,7 +365,7 @@ int tipc_portunreturnable(u32 ref, unsigned int *isunrejectable)
365 return -EINVAL; 365 return -EINVAL;
366 *isunrejectable = port_unreturnable(p_ptr); 366 *isunrejectable = port_unreturnable(p_ptr);
367 tipc_port_unlock(p_ptr); 367 tipc_port_unlock(p_ptr);
368 return TIPC_OK; 368 return 0;
369} 369}
370 370
371int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable) 371int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable)
@@ -377,7 +377,7 @@ int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable)
377 return -EINVAL; 377 return -EINVAL;
378 msg_set_dest_droppable(&p_ptr->publ.phdr, (isunrejectable != 0)); 378 msg_set_dest_droppable(&p_ptr->publ.phdr, (isunrejectable != 0));
379 tipc_port_unlock(p_ptr); 379 tipc_port_unlock(p_ptr);
380 return TIPC_OK; 380 return 0;
381} 381}
382 382
383/* 383/*
@@ -963,7 +963,7 @@ static u32 port_dispatcher(struct tipc_port *dummy, struct sk_buff *buf)
963 tipc_k_signal((Handler)port_dispatcher_sigh, 0); 963 tipc_k_signal((Handler)port_dispatcher_sigh, 0);
964 } 964 }
965 spin_unlock_bh(&queue_lock); 965 spin_unlock_bh(&queue_lock);
966 return TIPC_OK; 966 return 0;
967} 967}
968 968
969/* 969/*
@@ -1068,14 +1068,14 @@ int tipc_createport(u32 user_ref,
1068 tipc_reg_add_port(up_ptr); 1068 tipc_reg_add_port(up_ptr);
1069 *portref = p_ptr->publ.ref; 1069 *portref = p_ptr->publ.ref;
1070 tipc_port_unlock(p_ptr); 1070 tipc_port_unlock(p_ptr);
1071 return TIPC_OK; 1071 return 0;
1072} 1072}
1073 1073
1074int tipc_ownidentity(u32 ref, struct tipc_portid *id) 1074int tipc_ownidentity(u32 ref, struct tipc_portid *id)
1075{ 1075{
1076 id->ref = ref; 1076 id->ref = ref;
1077 id->node = tipc_own_addr; 1077 id->node = tipc_own_addr;
1078 return TIPC_OK; 1078 return 0;
1079} 1079}
1080 1080
1081int tipc_portimportance(u32 ref, unsigned int *importance) 1081int tipc_portimportance(u32 ref, unsigned int *importance)
@@ -1087,7 +1087,7 @@ int tipc_portimportance(u32 ref, unsigned int *importance)
1087 return -EINVAL; 1087 return -EINVAL;
1088 *importance = (unsigned int)msg_importance(&p_ptr->publ.phdr); 1088 *importance = (unsigned int)msg_importance(&p_ptr->publ.phdr);
1089 tipc_port_unlock(p_ptr); 1089 tipc_port_unlock(p_ptr);
1090 return TIPC_OK; 1090 return 0;
1091} 1091}
1092 1092
1093int tipc_set_portimportance(u32 ref, unsigned int imp) 1093int tipc_set_portimportance(u32 ref, unsigned int imp)
@@ -1102,7 +1102,7 @@ int tipc_set_portimportance(u32 ref, unsigned int imp)
1102 return -EINVAL; 1102 return -EINVAL;
1103 msg_set_importance(&p_ptr->publ.phdr, (u32)imp); 1103 msg_set_importance(&p_ptr->publ.phdr, (u32)imp);
1104 tipc_port_unlock(p_ptr); 1104 tipc_port_unlock(p_ptr);
1105 return TIPC_OK; 1105 return 0;
1106} 1106}
1107 1107
1108 1108
@@ -1137,7 +1137,7 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
1137 list_add(&publ->pport_list, &p_ptr->publications); 1137 list_add(&publ->pport_list, &p_ptr->publications);
1138 p_ptr->pub_count++; 1138 p_ptr->pub_count++;
1139 p_ptr->publ.published = 1; 1139 p_ptr->publ.published = 1;
1140 res = TIPC_OK; 1140 res = 0;
1141 } 1141 }
1142exit: 1142exit:
1143 tipc_port_unlock(p_ptr); 1143 tipc_port_unlock(p_ptr);
@@ -1160,7 +1160,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
1160 tipc_nametbl_withdraw(publ->type, publ->lower, 1160 tipc_nametbl_withdraw(publ->type, publ->lower,
1161 publ->ref, publ->key); 1161 publ->ref, publ->key);
1162 } 1162 }
1163 res = TIPC_OK; 1163 res = 0;
1164 } else { 1164 } else {
1165 list_for_each_entry_safe(publ, tpubl, 1165 list_for_each_entry_safe(publ, tpubl,
1166 &p_ptr->publications, pport_list) { 1166 &p_ptr->publications, pport_list) {
@@ -1174,7 +1174,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
1174 break; 1174 break;
1175 tipc_nametbl_withdraw(publ->type, publ->lower, 1175 tipc_nametbl_withdraw(publ->type, publ->lower,
1176 publ->ref, publ->key); 1176 publ->ref, publ->key);
1177 res = TIPC_OK; 1177 res = 0;
1178 break; 1178 break;
1179 } 1179 }
1180 } 1180 }
@@ -1218,7 +1218,7 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
1218 tipc_nodesub_subscribe(&p_ptr->subscription,peer->node, 1218 tipc_nodesub_subscribe(&p_ptr->subscription,peer->node,
1219 (void *)(unsigned long)ref, 1219 (void *)(unsigned long)ref,
1220 (net_ev_handler)port_handle_node_down); 1220 (net_ev_handler)port_handle_node_down);
1221 res = TIPC_OK; 1221 res = 0;
1222exit: 1222exit:
1223 tipc_port_unlock(p_ptr); 1223 tipc_port_unlock(p_ptr);
1224 p_ptr->publ.max_pkt = tipc_link_get_max_pkt(peer->node, ref); 1224 p_ptr->publ.max_pkt = tipc_link_get_max_pkt(peer->node, ref);
@@ -1240,7 +1240,7 @@ int tipc_disconnect_port(struct tipc_port *tp_ptr)
1240 /* let timer expire on it's own to avoid deadlock! */ 1240 /* let timer expire on it's own to avoid deadlock! */
1241 tipc_nodesub_unsubscribe( 1241 tipc_nodesub_unsubscribe(
1242 &((struct port *)tp_ptr)->subscription); 1242 &((struct port *)tp_ptr)->subscription);
1243 res = TIPC_OK; 1243 res = 0;
1244 } else { 1244 } else {
1245 res = -ENOTCONN; 1245 res = -ENOTCONN;
1246 } 1246 }
@@ -1305,7 +1305,7 @@ int tipc_isconnected(u32 ref, int *isconnected)
1305 return -EINVAL; 1305 return -EINVAL;
1306 *isconnected = p_ptr->publ.connected; 1306 *isconnected = p_ptr->publ.connected;
1307 tipc_port_unlock(p_ptr); 1307 tipc_port_unlock(p_ptr);
1308 return TIPC_OK; 1308 return 0;
1309} 1309}
1310 1310
1311int tipc_peer(u32 ref, struct tipc_portid *peer) 1311int tipc_peer(u32 ref, struct tipc_portid *peer)
@@ -1319,7 +1319,7 @@ int tipc_peer(u32 ref, struct tipc_portid *peer)
1319 if (p_ptr->publ.connected) { 1319 if (p_ptr->publ.connected) {
1320 peer->ref = port_peerport(p_ptr); 1320 peer->ref = port_peerport(p_ptr);
1321 peer->node = port_peernode(p_ptr); 1321 peer->node = port_peernode(p_ptr);
1322 res = TIPC_OK; 1322 res = 0;
1323 } else 1323 } else
1324 res = -ENOTCONN; 1324 res = -ENOTCONN;
1325 tipc_port_unlock(p_ptr); 1325 tipc_port_unlock(p_ptr);
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index a101de86824d..414fc34b8bea 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -123,7 +123,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start)
123 tipc_ref_table.index_mask = actual_size - 1; 123 tipc_ref_table.index_mask = actual_size - 1;
124 tipc_ref_table.start_mask = start & ~tipc_ref_table.index_mask; 124 tipc_ref_table.start_mask = start & ~tipc_ref_table.index_mask;
125 125
126 return TIPC_OK; 126 return 0;
127} 127}
128 128
129/** 129/**
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c
index 4146c40cd20b..506928803162 100644
--- a/net/tipc/user_reg.c
+++ b/net/tipc/user_reg.c
@@ -91,7 +91,7 @@ static int reg_init(void)
91 } 91 }
92 } 92 }
93 spin_unlock_bh(&reg_lock); 93 spin_unlock_bh(&reg_lock);
94 return users ? TIPC_OK : -ENOMEM; 94 return users ? 0 : -ENOMEM;
95} 95}
96 96
97/** 97/**
@@ -129,7 +129,7 @@ int tipc_reg_start(void)
129 tipc_k_signal((Handler)reg_callback, 129 tipc_k_signal((Handler)reg_callback,
130 (unsigned long)&users[u]); 130 (unsigned long)&users[u]);
131 } 131 }
132 return TIPC_OK; 132 return 0;
133} 133}
134 134
135/** 135/**
@@ -184,7 +184,7 @@ int tipc_attach(u32 *userid, tipc_mode_event cb, void *usr_handle)
184 184
185 if (cb && (tipc_mode != TIPC_NOT_RUNNING)) 185 if (cb && (tipc_mode != TIPC_NOT_RUNNING))
186 tipc_k_signal((Handler)reg_callback, (unsigned long)user_ptr); 186 tipc_k_signal((Handler)reg_callback, (unsigned long)user_ptr);
187 return TIPC_OK; 187 return 0;
188} 188}
189 189
190/** 190/**
@@ -230,7 +230,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
230 struct tipc_user *user_ptr; 230 struct tipc_user *user_ptr;
231 231
232 if (up_ptr->user_ref == 0) 232 if (up_ptr->user_ref == 0)
233 return TIPC_OK; 233 return 0;
234 if (up_ptr->user_ref > MAX_USERID) 234 if (up_ptr->user_ref > MAX_USERID)
235 return -EINVAL; 235 return -EINVAL;
236 if ((tipc_mode == TIPC_NOT_RUNNING) || !users ) 236 if ((tipc_mode == TIPC_NOT_RUNNING) || !users )
@@ -240,7 +240,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
240 user_ptr = &users[up_ptr->user_ref]; 240 user_ptr = &users[up_ptr->user_ref];
241 list_add(&up_ptr->uport_list, &user_ptr->ports); 241 list_add(&up_ptr->uport_list, &user_ptr->ports);
242 spin_unlock_bh(&reg_lock); 242 spin_unlock_bh(&reg_lock);
243 return TIPC_OK; 243 return 0;
244} 244}
245 245
246/** 246/**
@@ -250,7 +250,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
250int tipc_reg_remove_port(struct user_port *up_ptr) 250int tipc_reg_remove_port(struct user_port *up_ptr)
251{ 251{
252 if (up_ptr->user_ref == 0) 252 if (up_ptr->user_ref == 0)
253 return TIPC_OK; 253 return 0;
254 if (up_ptr->user_ref > MAX_USERID) 254 if (up_ptr->user_ref > MAX_USERID)
255 return -EINVAL; 255 return -EINVAL;
256 if (!users ) 256 if (!users )
@@ -259,6 +259,6 @@ int tipc_reg_remove_port(struct user_port *up_ptr)
259 spin_lock_bh(&reg_lock); 259 spin_lock_bh(&reg_lock);
260 list_del_init(&up_ptr->uport_list); 260 list_del_init(&up_ptr->uport_list);
261 spin_unlock_bh(&reg_lock); 261 spin_unlock_bh(&reg_lock);
262 return TIPC_OK; 262 return 0;
263} 263}
264 264