Skip to content

Commit

Permalink
dlm: remove redundant variable assignments
Browse files Browse the repository at this point in the history
Once the tcp_create_listen_sock() is returned successfully, we
will invoke add_sock() immediately. In add_sock(), the 'con'
variable is assigned to 'sk_user_data', meanwhile, the 'sock' is
also set to 'con->sock'. So it's unnecessary to do the same thing
in tcp_create_listen_sock().

Signed-off-by: Xue Ying <ying.xue@windriver.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Xue Ying authored and David Teigland committed Aug 10, 2012
1 parent 475f230 commit b4c798c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,10 +1175,8 @@ static struct socket *tcp_create_listen_sock(struct connection *con,
if (result < 0) {
log_print("Failed to set SO_REUSEADDR on socket: %d", result);
}
sock->sk->sk_user_data = con;
con->rx_action = tcp_accept_from_sock;
con->connect_action = tcp_connect_to_sock;
con->sock = sock;

/* Bind to our port */
make_sockaddr(saddr, dlm_config.ci_tcp_port, &addr_len);
Expand Down

0 comments on commit b4c798c

Please sign in to comment.