Commit d52de17b authored by Gerrit Renker's avatar Gerrit Renker Committed by David S. Miller

[DCCP]: Make `before' relation unambiguous

Problem:
parent 0aec51c8
...@@ -124,14 +124,11 @@ static inline s64 dccp_delta_seqno(const u64 seqno1, const u64 seqno2) ...@@ -124,14 +124,11 @@ static inline s64 dccp_delta_seqno(const u64 seqno1, const u64 seqno2)
/* is seq1 < seq2 ? */ /* is seq1 < seq2 ? */
static inline int before48(const u64 seq1, const u64 seq2) static inline int before48(const u64 seq1, const u64 seq2)
{ {
return (s64)((seq1 << 16) - (seq2 << 16)) < 0; return (s64)((seq2 << 16) - (seq1 << 16)) > 0;
} }
/* is seq1 > seq2 ? */ /* is seq1 > seq2 ? */
static inline int after48(const u64 seq1, const u64 seq2) #define after48(seq1, seq2) before48(seq2, seq1)
{
return (s64)((seq2 << 16) - (seq1 << 16)) < 0;
}
/* is seq2 <= seq1 <= seq3 ? */ /* is seq2 <= seq1 <= seq3 ? */
static inline int between48(const u64 seq1, const u64 seq2, const u64 seq3) static inline int between48(const u64 seq1, const u64 seq2, const u64 seq3)
......
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