Linux ATA/IDE development
 help / color / mirror / Atom feed
* ata_sff_data_xfer* return value
@ 2009-11-08 19:27 Krzysztof Halasa
  2009-11-08 20:00 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Halasa @ 2009-11-08 19:27 UTC (permalink / raw)
  To: linux-ide, lkml

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ata_sff_data_xfer* return value
  2009-11-08 19:27 ata_sff_data_xfer* return value Krzysztof Halasa
@ 2009-11-08 20:00 ` Alan Cox
  2009-11-08 20:06   ` Krzysztof Halasa
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2009-11-08 20:00 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: linux-ide, lkml

On Sun, 08 Nov 2009 20:27:02 +0100
Krzysztof Halasa <khc@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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ata_sff_data_xfer* return value
  2009-11-08 20:00 ` Alan Cox
@ 2009-11-08 20:06   ` Krzysztof Halasa
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Halasa @ 2009-11-08 20:06 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-ide, lkml

Alan Cox <alan@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-08 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-08 19:27 ata_sff_data_xfer* return value Krzysztof Halasa
2009-11-08 20:00 ` Alan Cox
2009-11-08 20:06   ` Krzysztof Halasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox