netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org
Subject: Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()
Date: Fri, 21 Dec 2007 01:46:20 -0800 (PST)	[thread overview]
Message-ID: <20071221.014620.91361895.davem@davemloft.net> (raw)
In-Reply-To: <476B6DAC.2030102@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri, 21 Dec 2007 08:39:24 +0100

> I didnt chose this path, because David was against changing some
> fields from 'int' to 'unsigned'. If you look in other parts of
> networking, we have many >> 1 or >> 2 already there.

I don't remember making this statement, where did I say this?
I'm genuinely curious :-)

But I am indeed against it in cases where the variable is compared
against signed quantities.

I think the shifts are more pretty and more closely match what the
programmer wants to come out of the compiler.  Getting all of these
divides is an awful surprise for me.

I've learned over the years to never explicitly code divides
or multiplies by powers of two and to always use shifts.  As
a result I am never surprised.  In fact I've been burnt every
time I mistakedly didn't use a shift.

Nevertheless, this tcplen arg is always assigned to and used
with unsigned quantities so I'll apply Yoshifuji's version of
the fix.

  parent reply	other threads:[~2007-12-21  9:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  6:03 [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack() Eric Dumazet
2007-12-21  6:50 ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21  7:06   ` Eric Dumazet
     [not found]     ` <20071221.162833.82587283.yoshfuji@linux-ipv6.org>
2007-12-21  7:39       ` Eric Dumazet
2007-12-21  7:44         ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21  7:50           ` Eric Dumazet
2007-12-21  9:46         ` David Miller [this message]
2007-12-21  8:11       ` Eric Dumazet
2007-12-21 11:26   ` Jeff Garzik
2007-12-21 11:57     ` David Miller
2007-12-21 12:18       ` Jeff Garzik
2007-12-21  7:21 ` Ilpo Järvinen

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=20071221.014620.91361895.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).