Re: I made a patch and would like feedback/testers (drivers/cdrom/aztcd.c)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>   static void op_ok(void)
>   {
> -	aztTimeOutCount = 0;
> +	aztTimeOut = jiffies + 2;
>   	do {
>   		aztIndatum = inb(DATA_PORT);
> -		aztTimeOutCount++;
> -		if (aztTimeOutCount >= AZT_TIMEOUT) {
> +		if (time_after(jiffies, aztTimeOut)) {
>   			printk("aztcd: Error Wait OP_OK\n");
>   			break;
>   		}
> +		schedule_timeout_interruptible(1);

this I think is not quite right; schedule_timeout_*() doesn't do
anything unless you set current->state to something. And at that point
you might as well start using msleep()!


but what you're doing is generally a good idea; busy waits as the
original code did is quite wrong...


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux