From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 5/25] Enforces a minimum interval of 10 milliseconds as per CCID-4 draft
Date: Thu, 08 Nov 2007 11:18:30 +0000 [thread overview]
Message-ID: <20071108111830.GC15246@gerrit.erg.abdn.ac.uk> (raw)
In-Reply-To: <200710312130.12981.leandroal@gmail.com>
| @@ -111,9 +111,11 @@ static inline u64 rfc3390_initial_rate(s
| */
| static inline void ccid4_update_send_interval(struct ccid4_hc_tx_sock *hctx)
| {
| - /* Calculate new t_ipi = s / X_inst (X_inst is in 64 * bytes/second) */
| - hctx->ccid4hctx_t_ipi = scaled_div32(((u64)hctx->ccid4hctx_s) << 6,
| - hctx->ccid4hctx_x);
| + /* Calculate new t_ipi = s / X_inst (X_inst is in 64 * bytes/second).
| + * TFRC-SP enforces a minimum interval of 10 milliseconds. */
| + hctx->ccid4hctx_t_ipi | + max_t(u32, scaled_div32(((u64)hctx->ccid4hctx_s) << 6,
| + hctx->ccid4hctx_x), MIN_SEND_RATE);
Whitespace - I have taken the liberty of replacing the above blanks with
tabs. Also a comment regarding comments: as far as I know the accepted
practice for multiline comments is
/*
* comment text which extends over one line
* and another
*/
While at it, I've done this also. Maybe the code would be clearer to read this way:
hctx->ccid4hctx_t_ipi = scaled_div32(((u64)hctx->ccid4hctx_s) << 6,
hctx->ccid4hctx_x));
if (hctx->ccid4hctx_t_ipi < MIN_SEND_RATE)
hctx->ccid4hctx_t_ipi = MIN_SEND_RATE;
This is one of the cases where the overly long tags `ccid4hctx_' are in the way.
If we had c4tx, the above reads
hctx->c4tx_t_ipi = scaled_div32(((u64)hctx->c4tx_s) <<6, hctx->c4tx_x));
if (hctx->c4tx_t_ipi < MIN_SEND_RATE)
hctx->c4tx_t_ipi = MIN_SEND_RATE;
So the problem is not your code, it is again these long identifiers. I
am overhauling the old CCID3 patch set, maybe this should be kept on the
todo list -- comments?
next prev parent reply other threads:[~2007-11-08 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-01 0:30 [PATCH 5/25] Enforces a minimum interval of 10 milliseconds as per CCID-4 draft Leandro
2007-11-03 1:00 ` Ian McDonald
2007-11-08 11:18 ` Gerrit Renker [this message]
2007-11-09 21:11 ` [PATCH 5/25] Enforces a minimum interval of 10 milliseconds as Tommi Saviranta
2007-11-13 16:19 ` [PATCH 5/25] Enforces a minimum interval of 10 milliseconds as per CCID-4 draft Łeandro Sales
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=20071108111830.GC15246@gerrit.erg.abdn.ac.uk \
--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