Skip to content

Commit

Permalink
rxrpc: Use before_eq() and friends to compare serial numbers
Browse files Browse the repository at this point in the history
before_eq() and friends should be used to compare serial numbers (when not
checking for (non)equality) rather than casting to int, subtracting and
checking the result.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Sep 23, 2016
1 parent 90bd684 commit 98dafac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rxrpc/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb,
}

/* Discard any out-of-order or duplicate ACKs. */
if ((int)sp->hdr.serial - (int)call->acks_latest <= 0) {
if (before_eq(sp->hdr.serial, call->acks_latest)) {
_debug("discard ACK %d <= %d",
sp->hdr.serial, call->acks_latest);
return;
Expand Down

0 comments on commit 98dafac

Please sign in to comment.