summaryrefslogtreecommitdiffstats
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-03-20 17:00:26 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 07:26:44 +0200
commitd52de17b8cf36d43a9d6977e7861a9f415541c6b (patch)
tree9746b89deb8b48b043a2de4016145c97f45765ad /net/dccp/dccp.h
parent[DCCP]: Make dccp_delta_seqno return signed numbers (diff)
downloadlinux-d52de17b8cf36d43a9d6977e7861a9f415541c6b.tar.xz
linux-d52de17b8cf36d43a9d6977e7861a9f415541c6b.zip
[DCCP]: Make `before' relation unambiguous
Problem:
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index afb313ff216e..1615986a8d92 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -124,14 +124,11 @@ static inline s64 dccp_delta_seqno(const u64 seqno1, const u64 seqno2)
/* is seq1 < 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 ? */
-static inline int after48(const u64 seq1, const u64 seq2)
-{
- return (s64)((seq2 << 16) - (seq1 << 16)) < 0;
-}
+#define after48(seq1, seq2) before48(seq2, seq1)
/* is seq2 <= seq1 <= seq3 ? */
static inline int between48(const u64 seq1, const u64 seq2, const u64 seq3)