aboutsummaryrefslogtreecommitdiff
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2008-07-14 22:44:01 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-14 22:44:01 -0700
commit0e35fd5e5264bb46d1febbe9cd9aa08421c21a96 (patch)
tree984ea14bf1e691d02b3202abeff087ba4369bc44 /net/tipc/link.c
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>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 9784a8e963b..d60113ba4b1 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1561,7 +1561,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
l_ptr->retransm_queue_head = mod(++r_q_head);
l_ptr->retransm_queue_size = --r_q_size;
l_ptr->stats.retransmitted++;
- return TIPC_OK;
+ return 0;
} else {
l_ptr->stats.bearer_congs++;
msg_dbg(buf_msg(buf), "|>DEF-RETR>");
@@ -1580,7 +1580,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
l_ptr->unacked_window = 0;
buf_discard(buf);
l_ptr->proto_msg_queue = NULL;
- return TIPC_OK;
+ return 0;
} else {
msg_dbg(buf_msg(buf), "|>DEF-PROT>");
l_ptr->stats.bearer_congs++;
@@ -1604,7 +1604,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
msg_set_type(msg, CLOSED_MSG);
msg_dbg(msg, ">PUSH-DATA>");
l_ptr->next_out = buf->next;
- return TIPC_OK;
+ return 0;
} else {
msg_dbg(msg, "|PUSH-DATA|");
l_ptr->stats.bearer_congs++;
@@ -1628,8 +1628,8 @@ void tipc_link_push_queue(struct link *l_ptr)
do {
res = tipc_link_push_packet(l_ptr);
- }
- while (res == TIPC_OK);
+ } while (!res);
+
if (res == PUSH_FAILED)
tipc_bearer_schedule(l_ptr->b_ptr, l_ptr);
}
@@ -2998,7 +2998,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
link_set_supervision_props(l_ptr, new_value);
tipc_link_send_proto_msg(l_ptr, STATE_MSG,
0, 0, new_value, 0, 0);
- res = TIPC_OK;
+ res = 0;
}
break;
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
l_ptr->priority = new_value;
tipc_link_send_proto_msg(l_ptr, STATE_MSG,
0, 0, 0, new_value, 0);
- res = TIPC_OK;
+ res = 0;
}
break;
case TIPC_CMD_SET_LINK_WINDOW:
if ((new_value >= TIPC_MIN_LINK_WIN) &&
(new_value <= TIPC_MAX_LINK_WIN)) {
tipc_link_set_queue_limits(l_ptr, new_value);
- res = TIPC_OK;
+ res = 0;
}
break;
}
@@ -3230,7 +3230,7 @@ int link_control(const char *name, u32 op, u32 val)
if (op == TIPC_CMD_UNBLOCK_LINK) {
l_ptr->blocked = 0;
}
- res = TIPC_OK;
+ res = 0;
}
tipc_node_unlock(node);
}