Commit ea2e90df authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller

[RXRPC]: Decrease number of pointer derefs in connection.c

Decrease the number of pointer derefs in net/rxrpc/connection.c

Benefits of the patch:
 - Fewer pointer dereferences should make the code slightly faster.
 - Size of generated code is smaller
 - improved readability
Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad8e4b75
...@@ -220,6 +220,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer, ...@@ -220,6 +220,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
{ {
struct rxrpc_connection *conn, *candidate = NULL; struct rxrpc_connection *conn, *candidate = NULL;
struct list_head *_p; struct list_head *_p;
struct sk_buff *pkt = msg->pkt;
int ret, fresh = 0; int ret, fresh = 0;
__be32 x_epoch, x_connid; __be32 x_epoch, x_connid;
__be16 x_port, x_servid; __be16 x_port, x_servid;
...@@ -229,10 +230,10 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer, ...@@ -229,10 +230,10 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
_enter("%p{{%hu}},%u,%hu", _enter("%p{{%hu}},%u,%hu",
peer, peer,
peer->trans->port, peer->trans->port,
ntohs(msg->pkt->h.uh->source), ntohs(pkt->h.uh->source),
ntohs(msg->hdr.serviceId)); ntohs(msg->hdr.serviceId));
x_port = msg->pkt->h.uh->source; x_port = pkt->h.uh->source;
x_epoch = msg->hdr.epoch; x_epoch = msg->hdr.epoch;
x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED; x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED;
x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK); x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK);
...@@ -267,7 +268,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer, ...@@ -267,7 +268,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
/* fill in the specifics */ /* fill in the specifics */
candidate->addr.sin_family = AF_INET; candidate->addr.sin_family = AF_INET;
candidate->addr.sin_port = x_port; candidate->addr.sin_port = x_port;
candidate->addr.sin_addr.s_addr = msg->pkt->nh.iph->saddr; candidate->addr.sin_addr.s_addr = pkt->nh.iph->saddr;
candidate->in_epoch = x_epoch; candidate->in_epoch = x_epoch;
candidate->out_epoch = x_epoch; candidate->out_epoch = x_epoch;
candidate->in_clientflag = RXRPC_CLIENT_INITIATED; candidate->in_clientflag = RXRPC_CLIENT_INITIATED;
...@@ -675,6 +676,7 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn, ...@@ -675,6 +676,7 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn,
struct rxrpc_message *msg) struct rxrpc_message *msg)
{ {
struct rxrpc_message *pmsg; struct rxrpc_message *pmsg;
struct dst_entry *dst;
struct list_head *_p; struct list_head *_p;
unsigned cix, seq; unsigned cix, seq;
int ret = 0; int ret = 0;
...@@ -710,10 +712,10 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn, ...@@ -710,10 +712,10 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn,
call->pkt_rcv_count++; call->pkt_rcv_count++;
if (msg->pkt->dst && msg->pkt->dst->dev) dst = msg->pkt->dst;
if (dst && dst->dev)
conn->peer->if_mtu = conn->peer->if_mtu =
msg->pkt->dst->dev->mtu - dst->dev->mtu - dst->dev->hard_header_len;
msg->pkt->dst->dev->hard_header_len;
/* queue on the call in seq order */ /* queue on the call in seq order */
rxrpc_get_message(msg); rxrpc_get_message(msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment