lkml.org 
[lkml]   [2000]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Recent change in tcp_output.c is surely wrong
    On Mon, Jan 17, 2000 at 05:49:43PM +0100, Jamie Lokier wrote:
    > I noticed this in pre-patch-2.3.40-4.gz:
    >
    >
    > /* Stay within the limit we were given */
    > - timeout = tp->ato;
    > + timeout = (tp->ato << 1) >> 1;
    > if (timeout > max_timeout)
    > timeout = max_timeout;
    >
    > What is the point of this?
    >
    > - If tp->ato has bit 31 set, then the effect depends on the width of `int'.
    > (Because all arithmetic operations in C extend to `int' width first).
    >
    > - If tp->ato is bit 31 clear, this has no effect.
    >
    > If the intention is to clear bit 31, `&= 0x7fffffff' is the thing which
    > works and is probably more efficient.

    and `&= (1U<<31)' is more obvious. Using a symbolic constant would be even
    better.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:56    [W:0.029 / U:59.700 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site