All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Roel Kluin <roel.kluin@gmail.com>,
	linux-ide@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: ide_timer_expiry() - shouldn't 'wait' be int?
Date: Mon, 2 Mar 2009 17:15:53 +0100	[thread overview]
Message-ID: <200903021715.53699.bzolnier@gmail.com> (raw)
In-Reply-To: <200903021651.01867.bzolnier@gmail.com>

On Monday 02 March 2009, Bartlomiej Zolnierkiewicz wrote:
> On Monday 02 March 2009, Sergei Shtylyov wrote:
> > Hello, I wrote:
> > 
> > >> vi drivers/ide/ide-io.c +906 and note:
> > 
> > >> void ide_timer_expiry (unsigned long data)
> > >> {
> > >>     ide_expiry_t *expiry = hwif->expiry;
> > >>     ...
> > >>     unsigned long   wait = -1;
> > 
> > >    Hm, haven't nothiced that this is *unsigned*.
> > 
> > >>         ...
> > >>         if (expiry) {
> > >>             ...
> > >>             wait = expiry(drive);
> > >>             if (wait > 0) { /* continue */
> > 
> > >> also note that in include/linux/ide.h:883:
> > 
> > >> typedef int (ide_expiry_t)(ide_drive_t *);
> > 
> > >> doesn't this mean that expiry returns int, and wait therefore should
> > >> be int as well?
> > 
> > >    It rather means that ide_expiry_t() should return unsigned.
> > 
> >     Er, not really, as it can return -1 too.
> 
> It can just return 0 instead.

This time I got confused.  ide_dma_timeout_retry() takes different actions
depending on error == -1 and error == 0.

[ BTW I worked on unifying those cases so ->dma_test_irq call can be moved
  out from ide_dma_timeout_retry() to ide_timer_expiry() (=> it can be later
  merged with ->expiry tests)... ]

Thanks,
Bart

  reply	other threads:[~2009-03-02 16:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 14:18 ide_timer_expiry() - shouldn't 'wait' be int? Roel Kluin
2009-03-02 14:38 ` Sergei Shtylyov
2009-03-02 14:58   ` Bartlomiej Zolnierkiewicz
2009-03-02 15:17     ` Roel Kluin
2009-03-02 15:29       ` Bartlomiej Zolnierkiewicz
2009-03-02 15:53         ` Sergei Shtylyov
2009-03-05 12:59         ` Bartlomiej Zolnierkiewicz
2009-03-02 15:39     ` Sergei Shtylyov
2009-03-02 15:45       ` Bartlomiej Zolnierkiewicz
2009-03-02 15:45   ` Sergei Shtylyov
2009-03-02 15:51     ` Bartlomiej Zolnierkiewicz
2009-03-02 16:15       ` Bartlomiej Zolnierkiewicz [this message]
2009-03-02 14:50 ` Bartlomiej Zolnierkiewicz
2009-03-02 15:43   ` Sergei Shtylyov
2009-03-02 15:51     ` Bartlomiej Zolnierkiewicz
2009-03-02 15:56       ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200903021715.53699.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    --cc=sshtylyov@ru.mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.