All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 20/21] polling loops: change exit condition to
@ 2005-12-04  0:24 Marcin Slusarz
  2005-12-04  4:15 ` Jesper Juhl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Marcin Slusarz @ 2005-12-04  0:24 UTC (permalink / raw)
  To: kernel-janitors

who is responsible for those files?

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/serial/icom.c linux-2.6.15-rc4/drivers/serial/icom.c
--- linux-2.6.15-rc4-orig/drivers/serial/icom.c	2005-11-20 16:53:29.000000000 +0100
+++ linux-2.6.15-rc4/drivers/serial/icom.c	2005-12-03 16:53:10.000000000 +0100
@@ -350,6 +350,7 @@ static void load_code(struct icom_port *
 	unsigned char *new_page = NULL;
 	unsigned char cable_id = NO_CABLE;
 	struct pci_dev *dev = icom_port->adapter->pci_dev;
+	unsigned long end_time;
 
 	/* Clear out any pending interrupts */
 	writew(0x3FFF, icom_port->int_reg);
@@ -461,13 +462,14 @@ static void load_code(struct icom_port *
 	writeb(START_DOWNLOAD, &icom_port->dram->sync);
 
 	/* Wait max 1 Sec for data download and processor to start */
-	for (index = 0; index < 10; index++) {
+	end_time = jiffies + msecs_to_jiffies(1000);
+	while (time_before(jiffies, end_time)) {
 		msleep(100);
 		if (readb(&icom_port->dram->misc_flags) & ICOM_HDW_ACTIVE)
 			break;
 	}
 
-	if (index = 10)
+	if (time_after_eq(jiffies, end_time))
 		status = -1;
 
 	/*
@@ -1015,11 +1017,13 @@ static void icom_send_xchar(struct uart_
 	unsigned char xdata;
 	int index;
 	unsigned long flags;
+	unsigned long end_time;
 
 	trace(ICOM_PORT, "SEND_XCHAR", ch);
 
 	/* wait .1 sec to send char */
-	for (index = 0; index < 10; index++) {
+	end_time = jiffies + msecs_to_jiffies(100);
+	while (time_before(jiffies, end_time)) {
 		spin_lock_irqsave(&port->lock, flags);
 		xdata = readb(&ICOM_PORT->dram->xchar);
 		if (xdata = 0x00) {
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-12-04 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-04  0:24 [KJ] [PATCH 20/21] polling loops: change exit condition to Marcin Slusarz
2005-12-04  4:15 ` Jesper Juhl
2005-12-04  5:06 ` Roland Dreier
2005-12-04  5:09 ` Jesper Juhl
2005-12-04 10:55 ` 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.