mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: tim@physik3.uni-rostock.de
Cc: adilger@turbolabs.com, jgarzik@mandrakesoft.com,
	andrewm@uow.edu.au, linux-kernel@vger.kernel.org,
	torvalds@transmeta.com, netdev@oss.sgi.com, ak@muc.de,
	kuznet@ms2.inr.ac.ru
Subject: Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup
Date: Wed, 07 Nov 2001 17:09:40 -0800 (PST)	[thread overview]
Message-ID: <20011107.170940.10246156.davem@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0111080157180.29908-100000@gans.physik3.uni-rostock.de>
In-Reply-To: <20011107.164426.35502643.davem@redhat.com> <Pine.LNX.4.30.0111080157180.29908-100000@gans.physik3.uni-rostock.de>

   From: Tim Schmielau <tim@physik3.uni-rostock.de>
   Date: Thu, 8 Nov 2001 01:58:45 +0100 (CET)

   Please consider to change the appended ones.
   
   --- linux-2.4.14/net/ipv4/route.c	Wed Oct 31 00:08:12 2001
   +++ linux-2.4.14-jiffies64/net/ipv4/route.c	Wed Nov  7 22:51:23 2001
   @@ -395,7 +395,7 @@
    		write_unlock(&rt_hash_table[i].lock);
   
    		/* Fallback loop breaker. */
   -		if ((jiffies - now) > 0)
   +		if ((long)(jiffies - now) > 0)
    			break;
    	}
    	rover = i;

Nothing is wrong with this case.  Jiffies is guarenteed to be greater
than or equal to "now".  There is no need to cast it to a signed type.

Let me say this again, in another way :-)

	SOME_WRAPPED_AROUND_SMALL_VALUE

	MINUS

	SOME_HUGE_ABOUT_TO_WRAP_AROUND_VALUE

will have the same result, signed or not.  Check this out!

(gdb) p (long)0x2 - (long)0xfffffff8
$1 = 10
(gdb) p (unsigned long)0x2 - (unsigned long)0xfffffff8
$2 = 10

It's math and the computer comfirms it! :-)))

Please show me a failure case for this statement if you disagree
with me.

   --- linux-2.4.14/net/ipv4/ipconfig.c	Wed Oct 31 00:08:12 2001
   +++ linux-2.4.14-jiffies64/net/ipv4/ipconfig.c	Wed Nov  7 23:28:47 2001

These cases are indeed buggy.  I'd rather fix these ones with
time_{after,before}() though.  And again, your "signed" casts
are totally superfluous.

Franks a lot,
David S. Miller
davem@redhat.com

  parent reply	other threads:[~2001-11-08  1:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-08  0:00 Tim Schmielau
2001-11-08  0:09 ` David S. Miller
2001-11-08  0:36   ` Andreas Dilger
2001-11-08  1:22     ` Linus Torvalds
2001-11-08  0:44   ` David S. Miller
2001-11-08  0:58     ` Tim Schmielau
2001-11-08  1:09     ` David S. Miller [this message]
2001-11-08  1:20       ` Tim Schmielau
2001-11-08  1:36       ` David S. Miller
2001-11-08  4:32     ` Andreas Dilger
2001-11-08  4:39     ` David S. Miller
2001-11-08 17:54   ` kuznet
2001-11-08 18:10     ` Tim Schmielau
2001-11-08 18:10     ` Andreas Dilger
2001-11-08 18:32       ` kuznet
2001-11-08  3:07 Krishna Kumar
2001-11-08  5:26 ` Linus Torvalds
2001-11-08 16:55 Krishna Kumar
2001-11-08 17:10 ` Linus Torvalds
2001-11-08 18:01 ` Andreas Dilger
2001-11-09 10:43 ` Vino Thomas
2001-11-08 17:47 Krishna Kumar

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=20011107.170940.10246156.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=adilger@turbolabs.com \
    --cc=ak@muc.de \
    --cc=andrewm@uow.edu.au \
    --cc=jgarzik@mandrakesoft.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=tim@physik3.uni-rostock.de \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®