From: Vojtech Pavlik <vojtech@suse.cz>
To: Denis Vlasenko <vda@ilport.com.ua>
Cc: Grant Coady <grant_lkml@dodo.com.au>,
Simon Evans <spse@secret.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: New inventions in rounding up in catc.c?
Date: Sun, 25 Sep 2005 22:54:55 +0200 [thread overview]
Message-ID: <20050925205455.GA6747@midnight.ucw.cz> (raw)
In-Reply-To: <200509251343.47892.vda@ilport.com.ua>
On Sun, Sep 25, 2005 at 01:43:47PM +0300, Denis Vlasenko wrote:
> On Saturday 24 September 2005 21:46, Grant Coady wrote:
> > On Sat, 24 Sep 2005 13:43:42 +0300, Denis Vlasenko <vda@ilport.com.ua> wrote:
> > > /* F5U011 only does one packet per RX */
> > > if (catc->is_f5u011)
> > > break;
> > >- pkt_start += (((pkt_len + 1) >> 6) + 1) << 6;
> > >+ pkt_start += ((pkt_len + 2) + 63) & ~63;
> >
> > pkt_start += ((pkt_len + 1) + 64) & ~63;
> >
> > Seems more clear to me.
>
> Why?
>
> ((pkt_len + 2) + 63) & ~63 is "add 2 and round up to next 64".
> ((pkt_len + 1) + 64) & ~63 is "???!"
>
> It's strange code anyway, I hope maintainer can clarify what's going on.
> (I suspect it was intended to be pkt_len - 1, not +, in the first place)
Honestly, I don't remember at all. I'll try to find the (very old) docs
I have for the chip.
--
Vojtech Pavlik
SuSE Labs, SuSE CR
prev parent reply other threads:[~2005-09-25 20:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-24 10:43 New inventions in rounding up in catc.c? Denis Vlasenko
2005-09-24 18:46 ` Grant Coady
2005-09-25 10:43 ` Denis Vlasenko
2005-09-25 20:54 ` Vojtech Pavlik [this message]
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=20050925205455.GA6747@midnight.ucw.cz \
--to=vojtech@suse.cz \
--cc=grant_lkml@dodo.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=spse@secret.org.uk \
--cc=vda@ilport.com.ua \
/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