From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: [PATCH 5/5][REVISED]: Introduce macro for incrementing modulo-48
Date: Wed, 03 Jan 2007 13:08:23 +0000 [thread overview]
Message-ID: <200701031308.24007@strip-the-willow> (raw)
[DCCP]: Introduce macro for incrementing modulo-48
Problem: DCCP sequence numbers are mostly stored in 48-bit bitfields
which are acommodated within an u64 number. For these fields,
dccp_inc_seqno() can not be used since it takes a u64 pointer.
Fix: Solved by introducing an INC48() macro to increment modulo-2^48.
Note: This macro can be used in several places within the ccid3 code.
However, these changes affect others in turn and therefore require
a separate patch.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/dccp/dccp.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -102,6 +102,7 @@ extern int sysctl_dccp_tx_qlen;
#define TO_UNSIGNED48(x) (((x) >= 0)? (x) : COMPLEMENT48(-(x)))
#define ADD48(a, b) (((a) + (b)) & DCCP_MAX_SEQNO)
#define SUB48(a, b) ADD48((a), COMPLEMENT48(b))
+#define INC48(seqno) seqno = ADD48(seqno, 1)
static inline void dccp_set_seqno(u64 *seqno, u64 value)
{
@@ -110,7 +111,7 @@ static inline void dccp_set_seqno(u64 *s
static inline void dccp_inc_seqno(u64 *seqno)
{
- *seqno = ADD48(*seqno, 1);
+ INC48(*seqno);
}
/* return > 0 if seqno1 is `before' seqno2, <= 0 otherwise */
next reply other threads:[~2007-01-03 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 13:08 Gerrit Renker [this message]
2007-01-04 18:21 ` [PATCH 5/5][REVISED]: Introduce macro for incrementing modulo-48 Ian McDonald
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200701031308.24007@strip-the-willow \
--to=gerrit@erg.abdn.ac.uk \
--cc=dccp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox