netdevice: ticks reaches 25, not 26.
Subsystems (2)
PATCH 1/1 netdevice: ticks reaches 25, not 26.
With while (tick++ < 25) { ... } ticks reaches 25, not 26.
---
drivers/net/myri_sbus.c +1 -1
@@ -161,7 +161,7 @@ static int myri_do_handshake(struct myri_eth *mp)myri_enable_irq (mp->lregs, cregs); -if (tick >25 ) { +if (tick >=25 ) {DET (("25 ticks we lose, failure.\n" ));return -1 ; }
David Miller
maintainerFrom: Roel Kluin <[email protected]>
Date: Mon, 09 Feb 2009 23:22:11 +0100
Quoted 1 line
With while (tick++ < 25) { ... } ticks reaches 25, not 26.
Does it?
--------------------
#include <stdio.h>
int main(void)
{
int i = 0;
while (i++ < 25)
;
printf("%d\n", i);
return 0;
}
--------------------
davem@sunset:~/src/GIT/linux-2.6$ gcc -O2 -o x x.c
davem@sunset:~/src/GIT/linux-2.6$ ./x
26
davem@sunset:~/src/GIT/linux-2.6$ I'm getting extremely tired of these "off by one" patches, to be honest with you.
Quoted 24 lines · David Miller
From: Roel Kluin <[email protected]>
Date: Mon, 09 Feb 2009 23:22:11 +0100Quoted 1 line
With while (tick++ < 25) { ... } ticks reaches 25, not 26.
Does it?
--------------------
#include <stdio.h>
int main(void){ int i = 0; while (i++ < 25) ; printf("%d\n", i); return 0; } -------------------- davem@sunset:~/src/GIT/linux-2.6$ gcc -O2 -o x x.c davem@sunset:~/src/GIT/linux-2.6$ ./x 26 davem@sunset:~/src/GIT/linux-2.6$
Quoted 2 lines
I'm getting extremely tired of these "off by one" patches, to be honest with you.
So, what other C feature do you find a better source of joy now?
Jarek P.
David Miller
maintainerFrom: Jarek Poplawski <[email protected]>
Date: Tue, 10 Feb 2009 08:50:21 +0000
Quoted 1 line
So, what other C feature do you find a better source of joy now?
None really, that's why most of my own patches lately have been doing nothing but remove code :-)
Quoted 6 lines · David Miller
From: Roel Kluin <[email protected]>
Date: Mon, 09 Feb 2009 23:22:11 +0100Quoted 1 line
With while (tick++ < 25) { ... } ticks reaches 25, not 26.
Does it?
Again, you're right, sorry, please ignore :-/