long wait = (HZ + 99) / 100; 
long wait = msecs_to_jiffies(10); 
size_t parport_ieee1284_write_compat (struct parport *port,				      const void *buffer, size_t len,				      int flags){	int no_irq = 1;	ssize_t count = 0;	const unsigned char *addr = buffer;	unsigned char byte;	struct pardevice *dev = port->physport->cad;	unsigned char ctl = (PARPORT_CONTROL_SELECT			     | PARPORT_CONTROL_INIT);	if (port->irq != PARPORT_IRQ_NONE) {		parport_enable_irq (port);		no_irq = 0;	}	port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;	parport_write_control (port, ctl);	parport_data_forward (port);	while (count < len) {		unsigned long expire = jiffies + dev->timeout;		long wait = (HZ + 99) / 100;		unsigned char mask = (PARPORT_STATUS_ERROR				      | PARPORT_STATUS_BUSY);		unsigned char val = (PARPORT_STATUS_ERROR				     | PARPORT_STATUS_BUSY);		/* Wait until the peripheral's ready */		do {			/* Is the peripheral ready yet? */			if (!parport_wait_peripheral (port, mask, val))				/* Skip the loop */				goto ready;			/* Is the peripheral upset? */			if ((parport_read_status (port) &			     (PARPORT_STATUS_PAPEROUT |			      PARPORT_STATUS_SELECT |			      PARPORT_STATUS_ERROR))			    != (PARPORT_STATUS_SELECT |				PARPORT_STATUS_ERROR))				/* If nFault is asserted (i.e. no				 * error) and PAPEROUT and SELECT are				 * just red herrings, give the driver				 * a chance to check it's happy with				 * that before continuing. */				goto stop;			/* Have we run out of time? */			if (!time_before (jiffies, expire))				break;			/* Yield the port for a while.  If this is the                           first time around the loop, don't let go of                           the port.  This way, we find out if we have                           our interrupt handler called. */			if (count && no_irq) {				parport_release (dev);				__set_current_state (TASK_INTERRUPTIBLE);				schedule_timeout (wait);				parport_claim_or_block (dev);			}			else				/* We must have the device claimed here */				parport_wait_event (port, wait);			/* Is there a signal pending? */			if (signal_pending (current))				break;			/* Wait longer next time. */			wait *= 2;		} while (time_before (jiffies, expire));		if (signal_pending (current))			break;		DPRINTK (KERN_DEBUG "%s: Timed out\n", port->name);		break;	ready:		/* Write the character to the data lines. */		byte = *addr++;		parport_write_data (port, byte);		udelay (1);		/* Pulse strobe. */		parport_write_control (port, ctl | PARPORT_CONTROL_STROBE);		udelay (1); /* strobe */		parport_write_control (port, ctl);		udelay (1); /* hold */		/* Assume the peripheral received it. */		count++;                /* Let another process run if it needs to. */		if (time_before (jiffies, expire))			if (!parport_yield_blocking (dev)			    && need_resched())				schedule ();	} stop:	port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE;	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f/ieee1284_ops.c/buggy/drivers/parport/ieee1284_ops.c