* [KJ] [PATCH 7/21] polling loops: change exit condition to
@ 2005-12-04 0:17 Marcin Slusarz
2005-12-04 7:18 ` Daniel Marjamäki
2005-12-04 10:54 ` Marcin Slusarz
0 siblings, 2 replies; 3+ messages in thread
From: Marcin Slusarz @ 2005-12-04 0:17 UTC (permalink / raw)
To: kernel-janitors
IEEE 1394 SBP2
P: Ben Collins
M: bcollins@debian.org
P: Stefan Richter
M: stefanr@s5r6.in-berlin.de
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
diff -upr -X linux-2.6.15-rc4/Documentation/dontdiff linux-2.6.15-rc4-orig/drivers/ieee1394/sbp2.c linux-2.6.15-rc4/drivers/ieee1394/sbp2.c
--- linux-2.6.15-rc4-orig/drivers/ieee1394/sbp2.c 2005-12-03 15:22:32.000000000 +0100
+++ linux-2.6.15-rc4/drivers/ieee1394/sbp2.c 2005-12-03 16:53:10.000000000 +0100
@@ -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
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [KJ] [PATCH 7/21] polling loops: change exit condition to
2005-12-04 0:17 [KJ] [PATCH 7/21] polling loops: change exit condition to Marcin Slusarz
@ 2005-12-04 7:18 ` Daniel Marjamäki
2005-12-04 10:54 ` Marcin Slusarz
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Marjamäki @ 2005-12-04 7:18 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
time_after / time_before
Message-Id: <20051204081814.067b93c0.daniel.marjamaki@comhem.se>
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
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [KJ] [PATCH 7/21] polling loops: change exit condition to
2005-12-04 0:17 [KJ] [PATCH 7/21] polling loops: change exit condition to Marcin Slusarz
2005-12-04 7:18 ` Daniel Marjamäki
@ 2005-12-04 10:54 ` Marcin Slusarz
1 sibling, 0 replies; 3+ messages in thread
From: Marcin Slusarz @ 2005-12-04 10:54 UTC (permalink / raw)
To: kernel-janitors
Daniel Marjamäki wrote:
> Patch for: drivers/ieee1394/sbp2.c
>
> Are you sure about this line
> + 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
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-12-04 10:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-04 0:17 [KJ] [PATCH 7/21] polling loops: change exit condition to Marcin Slusarz
2005-12-04 7:18 ` Daniel Marjamäki
2005-12-04 10:54 ` Marcin Slusarz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.