diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2008-07-14 22:42:19 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-14 22:42:19 -0700 |
commit | 0ea522416b658dedfc9d565b331624a55a6260ad (patch) | |
tree | 3cfa3e72bae112b76d5810bd55a9610b29e42f26 /net/tipc/socket.c | |
parent | 3cb29b1bca00736e984ea8ab368af40394a1bca0 (diff) |
tipc: Remove unneeded parameter to tipc_createport_raw()
This patch eliminates an unneeded parameter when creating a low-level
TIPC port object. Instead of returning both the pointer to the port
structure and the port's reference ID, it now returns only the pointer
since the port structure contains the reference ID as one of its fields.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 38f48795b40..9c362c5759b 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2,7 +2,7 @@ * net/tipc/socket.c: TIPC socket API * * Copyright (c) 2001-2007, Ericsson AB - * Copyright (c) 2004-2007, Wind River Systems + * Copyright (c) 2004-2008, Wind River Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -189,7 +189,6 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol) socket_state state; struct sock *sk; struct tipc_port *tp_ptr; - u32 portref; /* Validate arguments */ @@ -225,9 +224,9 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol) /* Allocate TIPC port for socket to use */ - portref = tipc_createport_raw(sk, &dispatch, &wakeupdispatch, - TIPC_LOW_IMPORTANCE, &tp_ptr); - if (unlikely(portref == 0)) { + tp_ptr = tipc_createport_raw(sk, &dispatch, &wakeupdispatch, + TIPC_LOW_IMPORTANCE); + if (unlikely(!tp_ptr)) { sk_free(sk); return -ENOMEM; } @@ -240,14 +239,14 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol) sock_init_data(sock, sk); sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT); sk->sk_backlog_rcv = backlog_rcv; - tipc_sk(sk)->p = tipc_get_port(portref); + tipc_sk(sk)->p = tp_ptr; spin_unlock_bh(tp_ptr->lock); if (sock->state == SS_READY) { - tipc_set_portunreturnable(portref, 1); + tipc_set_portunreturnable(tp_ptr->ref, 1); if (sock->type == SOCK_DGRAM) - tipc_set_portunreliable(portref, 1); + tipc_set_portunreliable(tp_ptr->ref, 1); } atomic_inc(&tipc_user_count); |