aboutsummaryrefslogtreecommitdiff
path: root/net/tipc/user_reg.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/user_reg.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/user_reg.c')
-rw-r--r--net/tipc/user_reg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c
index 4146c40cd20..50692880316 100644
--- a/net/tipc/user_reg.c
+++ b/net/tipc/user_reg.c
@@ -91,7 +91,7 @@ static int reg_init(void)
}
}
spin_unlock_bh(&reg_lock);
- return users ? TIPC_OK : -ENOMEM;
+ return users ? 0 : -ENOMEM;
}
/**
@@ -129,7 +129,7 @@ int tipc_reg_start(void)
tipc_k_signal((Handler)reg_callback,
(unsigned long)&users[u]);
}
- return TIPC_OK;
+ return 0;
}
/**
@@ -184,7 +184,7 @@ int tipc_attach(u32 *userid, tipc_mode_event cb, void *usr_handle)
if (cb && (tipc_mode != TIPC_NOT_RUNNING))
tipc_k_signal((Handler)reg_callback, (unsigned long)user_ptr);
- return TIPC_OK;
+ return 0;
}
/**
@@ -230,7 +230,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
struct tipc_user *user_ptr;
if (up_ptr->user_ref == 0)
- return TIPC_OK;
+ return 0;
if (up_ptr->user_ref > MAX_USERID)
return -EINVAL;
if ((tipc_mode == TIPC_NOT_RUNNING) || !users )
@@ -240,7 +240,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
user_ptr = &users[up_ptr->user_ref];
list_add(&up_ptr->uport_list, &user_ptr->ports);
spin_unlock_bh(&reg_lock);
- return TIPC_OK;
+ return 0;
}
/**
@@ -250,7 +250,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
int tipc_reg_remove_port(struct user_port *up_ptr)
{
if (up_ptr->user_ref == 0)
- return TIPC_OK;
+ return 0;
if (up_ptr->user_ref > MAX_USERID)
return -EINVAL;
if (!users )
@@ -259,6 +259,6 @@ int tipc_reg_remove_port(struct user_port *up_ptr)
spin_lock_bh(&reg_lock);
list_del_init(&up_ptr->uport_list);
spin_unlock_bh(&reg_lock);
- return TIPC_OK;
+ return 0;
}