Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ata_sff_data_xfer* return value

0 views
Skip to first unread message

Krzysztof Halasa

unread,
Nov 8, 2009, 2:30:02 PM11/8/09
to
Hi,

I wonder if this is entirely correct? If so, why?
Only relevant parts left.

* RETURNS:
* Bytes consumed.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
unsigned int ata_sff_data_xfer(struct ata_device *dev, unsigned char *buf,
unsigned int buflen, int rw)
{
unsigned int words = buflen >> 1;

...

/* Transfer trailing byte, if any. */
if (unlikely(buflen & 0x01)) {
...
words++;
}

return words << 1;

same here:

unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf,
unsigned int buflen, int rw)
{
...
return (buflen + 1) & ~1;

Please keep me in CC:, I'm not on the IDE list. Thanks.
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Alan Cox

unread,
Nov 8, 2009, 3:10:02 PM11/8/09
to
On Sun, 08 Nov 2009 20:27:02 +0100
Krzysztof Halasa <k...@pm.waw.pl> wrote:

> Hi,
>
> I wonder if this is entirely correct? If so, why?

It is correct. We return the bytes consumed as it may well not be the
same as the total bytes requested. In practice we don't currently do a
great deal with it even with ATAPI but it's useful for doing bug checks.

Krzysztof Halasa

unread,
Nov 8, 2009, 3:10:02 PM11/8/09
to
Alan Cox <al...@lxorguk.ukuu.org.uk> writes:

> It is correct. We return the bytes consumed as it may well not be the
> same as the total bytes requested. In practice we don't currently do a
> great deal with it even with ATAPI but it's useful for doing bug checks.

I see. Thanks.
--
Krzysztof Halasa

0 new messages