polling loops: change exit condition to
PATCH 7/21 polling loops: change exit condition to
IEEE 1394 SBP2
P: Ben Collins
M: [email protected]
P: Stefan Richter
M: [email protected]
drivers/ieee1394/sbp2.c +5 -4
@@ -360,13 +360,14 @@ static void sbp2util_packet_dump(void *b*/ static int sbp2util_down_timeout (atomic_t *done,int timeout) { -int i; +unsigned long end_time; -for (i = timeout; (i >0 &&atomic_read (done) =0 ); i-=HZ /10 ) { + end_time = jiffies +msecs_to_jiffies (timeout); +while (time_before (jiffies, end_time) &&atomic_read (done) =0 ) {if (msleep_interruptible (100 ))/* 100ms */ -return (1 ); +return 1 ; } -return ((i >0 ) ?0 :1 ); +return (time_before (jiffies, end_time) ?0 :1 ); }/* Free's an allocated packet */
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
time_after / time_before
Message-Id: <[email protected]>
X-Mailer: Sylpheed version 2.1.7 (GTK+ 2.8.8; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Patch for: drivers/ieee1394/sbp2.c
Are you sure about this line
+ end_time =3D jiffies + msecs_to_jiffies(timeout);
To me it seems timeout means nr of jiffies, not milliseconds.
Look at line 1286 in the file for example..
/* Wait up to 20 seconds */
if (sbp2util_down_timeout(blabla, 20*HZ)) {Best Regards,
Daniel Marjam=E4ki
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 10 lines · Daniel Marjamäki
Patch for:
drivers/ieee1394/sbp2.cAre you sure about this line
drivers/ieee1394/sbp2.c +1
-0+ end_time = jiffies +msecs_to_jiffies (timeout);To me it seems timeout means nr of jiffies, not milliseconds.
Look at line 1286 in the file for example..
/* Wait up to 20 seconds */ if (sbp2util_down_timeout(blabla, 20*HZ)) {
you are right, this line should look like this:end_time = jiffies + timeout;
regards,
Marcin Slusarz
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors