From: Eddie Kohler <kohler@cs.ucla.edu>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 1/5]: DCCP Fix use of invalid loss intervals
Date: Thu, 04 Jan 2007 21:49:28 +0000 [thread overview]
Message-ID: <459D7668.4050602@cs.ucla.edu> (raw)
In-Reply-To: <200612201544.22122.ian.mcdonald@jandi.co.nz>
Ian (catching up slowly slowly), here is a nit as nitty as they come.
This diff seems strange to me, since ~ actually does the same thing on
integers and unsigned integers. (This code:
printf("%u %u\n", ~0, ~0U);
will print the same thing twice.)
Perhaps dccplih_interval is a 64-bit number? In which case you want to
say something like ~0ULL?
Eddie
Ian McDonald wrote:
> I've been trying to fix up performance for CCID3 and found this little
> bug that means the comparison was invalid and we were using invalid loss
> intervals when we shouldn't of.
>
> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
> ---
> diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
> index 0a0baef..372d7e7 100644
> --- a/net/dccp/ccids/lib/loss_interval.c
> +++ b/net/dccp/ccids/lib/loss_interval.c
> @@ -91,7 +91,7 @@ u32 dccp_li_hist_calc_i_mean(struct list_head *list)
> u32 w_tot = 0;
>
> list_for_each_entry_safe(li_entry, li_next, list, dccplih_node) {
> - if (li_entry->dccplih_interval != ~0) {
> + if (li_entry->dccplih_interval != ~0U) {
> i_tot0 += li_entry->dccplih_interval * dccp_li_hist_w[i];
> w_tot += dccp_li_hist_w[i];
> if (i != 0)
> -
> To unsubscribe from this list: send the line "unsubscribe dccp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-01-04 21:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-20 2:44 [PATCH 1/5]: DCCP Fix use of invalid loss intervals Ian McDonald
2006-12-21 11:13 ` Gerrit Renker
2007-01-04 21:49 ` Eddie Kohler [this message]
2007-01-04 21:57 ` Ian McDonald
2007-01-04 22:17 ` Eddie Kohler
2007-01-04 22:45 ` Ian McDonald
2007-01-05 13:22 ` Gerrit Renker
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=459D7668.4050602@cs.ucla.edu \
--to=kohler@cs.ucla.edu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.