lkml.org 
[lkml]   [2005]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: I made a patch and would like feedback/testers (drivers/cdrom/aztcd.c)
From
Date
>   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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-20 16:40    [from the cache]
©2003-2011 Jasper Spaans