diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-03-20 11:45:59 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:26:43 -0400 |
commit | 0aec51c86986f61de26dd04913667af544a8b8eb (patch) | |
tree | 41c39d76acc58b8cebf7e36d69b7b528bb245289 | |
parent | 6b811d43f6cc9eccdfc011a99f8571df2abc46d1 (diff) |
[DCCP]: Make dccp_delta_seqno return signed numbers
Problem:
-rw-r--r-- | net/dccp/dccp.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index a2c20a265b25..afb313ff216e 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -113,9 +113,12 @@ static inline void dccp_inc_seqno(u64 *seqno) | |||
113 | *seqno = ADD48(*seqno, 1); | 113 | *seqno = ADD48(*seqno, 1); |
114 | } | 114 | } |
115 | 115 | ||
116 | static inline u64 dccp_delta_seqno(u64 seqno1, u64 seqno2) | 116 | /* signed mod-2^48 distance: pos. if seqno1 < seqno2, neg. if seqno1 > seqno2 */ |
117 | static inline s64 dccp_delta_seqno(const u64 seqno1, const u64 seqno2) | ||
117 | { | 118 | { |
118 | return ((seqno2 << 16) - (seqno1 << 16)) >> 16; | 119 | u64 delta = SUB48(seqno2, seqno1); |
120 | |||
121 | return TO_SIGNED48(delta); | ||
119 | } | 122 | } |
120 | 123 | ||
121 | /* is seq1 < seq2 ? */ | 124 | /* is seq1 < seq2 ? */ |