fore200e_spin(int msecs)
{
unsigned long timeout = jiffies + MSECS(msecs);
- while (jiffies < timeout);
+ while (time_before(jiffies, timeout));
}
if ((ok = (*addr == val)) || (*addr & STATUS_ERROR))
break;
- } while (jiffies < timeout);
+ } while (time_before(jiffies, timeout));
#if 1
if (!ok) {
if ((ok = (fore200e->bus->read(addr) == val)))
break;
- } while (jiffies < timeout);
+ } while (time_before(jiffies, timeout));
#if 1
if (!ok) {
unsigned long timeout = jiffies + MSECS(50);
int c;
- while (jiffies < timeout) {
+ while (time_before(jiffies, timeout)) {
c = (int) fore200e->bus->read(&monitor->soft_uart.recv);
/* Wait for the Link to come up and the login process
* to complete.
*/
- for(timeout = jiffies + 10*HZ; (timeout > jiffies) && ((fi->g.link_up == FALSE) || (fi->g.port_discovery == TRUE) || (fi->g.explore_fabric == TRUE) || (fi->g.perform_adisc == TRUE));)
+ for(timeout = jiffies + 10*HZ; time_before(jiffies, timeout) && ((fi->g.link_up == FALSE) || (fi->g.port_discovery == TRUE) || (fi->g.explore_fabric == TRUE) || (fi->g.perform_adisc == TRUE));)
+ {
+ cpu_relax();
barrier();
+ }
count++;
no_of_hosts++;
* Give the FirmWare time to chew on the `get running' command.
*/
myjif = jiffies + 5 * HZ;
- while ((jiffies < myjif) && !rrpriv->fw_running);
+ while (time_before(jiffies, myjif) && !rrpriv->fw_running);
netif_start_queue(dev);
#define DbgDelay(secs) { int wait_time; printk( " DbgDelay %ds ", secs); \
for( wait_time=jiffies + (secs*HZ); \
- wait_time > jiffies ;) ; }
+ time_before(jiffies, wait_time) ;) ; }
#define CPQFCTS_DRIVER_VER(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
// don't forget to also change MODULE_DESCRIPTION in cpqfcTSinit.c
timer_table[SCSI_TIMER].expires = jiffies + timeout;
timer_active |= 1 << SCSI_TIMER;
} else {
- if (jiffies + timeout < timer_table[SCSI_TIMER].expires)
+ if (time_before(jiffies + timeout, timer_table[SCSI_TIMER].expires))
timer_table[SCSI_TIMER].expires = jiffies + timeout;
}
}
int i,k;
k = 0;
i = jiffies + WATCHDOG;
- while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {
+ while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {
barrier();
cpu_relax();
}
- if (i <= jiffies)
+ if (time_after_eq(jiffies, i))
return (DID_TIME_OUT);
if (qabort)
return (qabort == 1 ? DID_ABORT : DID_RESET);
}
/*** Enter Status (and Message In) Phase ***/
k = jiffies + WATCHDOG;
- while ( k > jiffies && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
- if ( k <= jiffies ) {
+ while ( time_before(jiffies, k) && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
+ if ( time_after_eq(jiffies, k) ) {
ql_zap();
return (DID_TIME_OUT << 16);
}
outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
isp2x00_enable_irqs(host);
/* wait for the loop to come up */
- for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->adapter_state == AS_LOOP_DOWN;) {
+ for (wait_time = jiffies + 10 * HZ; time_before(jiffies, wait_time) && hostdata->adapter_state == AS_LOOP_DOWN;) {
barrier();
cpu_relax();
}
some time before recognizing it is attached to a fabric */
#if ISP2x00_FABRIC
- for (wait_time = jiffies + 5 * HZ; wait_time > jiffies;) {
+ for (wait_time = jiffies + 5 * HZ; time_before(jiffies, wait_time);) {
barrier();
cpu_relax();
}
NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
NCR5380_read( RESET_PARITY_INTERRUPT_REG );
- for( end = jiffies + AFTER_RESET_DELAY; jiffies < end; )
+ for( end = jiffies + AFTER_RESET_DELAY; time_before(jiffies, end); )
barrier();
/* switch on SCSI IRQ again */
while( count > 0 && ret == 0 ) {
while( (port->write_urb->status == -EINPROGRESS
- || priv->dp_write_urb_in_use) && jiffies < timeout ) {
+ || priv->dp_write_urb_in_use) && time_before(jiffies, timeout)) {
cond_wait_interruptible_timeout_irqrestore(
&port->write_wait, DIGI_RETRY_TIMEOUT,
&priv->dp_port_lock, flags );
spin_lock_irqsave( &priv->dp_port_lock, flags );
- while( jiffies < timeout && !priv->dp_transmit_idle ) {
+ while( time_before(jiffies, timeout) && !priv->dp_transmit_idle ) {
cond_wait_interruptible_timeout_irqrestore(
&priv->dp_transmit_idle_wait, DIGI_RETRY_TIMEOUT,
&priv->dp_port_lock, flags );