Skip to content

Commit

Permalink
rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
Browse files Browse the repository at this point in the history
I backed off from trying to just eliminate this variable, since
transforming atomic_inc_return() into atomic_inc() takes away
the memory barriers.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 19, 2011
1 parent c9d10c4 commit 2a64255
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/rxrpc/ar-peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp)
/* we can now add the new candidate to the list */
peer = candidate;
candidate = NULL;
usage = atomic_read(&peer->usage);

list_add_tail(&peer->link, &rxrpc_peers);
write_unlock_bh(&rxrpc_peer_lock);
Expand All @@ -171,7 +172,7 @@ struct rxrpc_peer *rxrpc_get_peer(struct sockaddr_rxrpc *srx, gfp_t gfp)
&peer->srx.transport.sin.sin_addr,
ntohs(peer->srx.transport.sin.sin_port));

_leave(" = %p {u=%d}", peer, atomic_read(&peer->usage));
_leave(" = %p {u=%d}", peer, usage);
return peer;

/* we found the peer in the list immediately */
Expand Down

0 comments on commit 2a64255

Please sign in to comment.