Re: [patch] 2.3.39: Don't use bounce buffer when not needed (parport)

Andrea Arcangeli (andrea@suse.de)
Thu, 13 Jan 2000 00:32:12 +0100 (CET)


On Wed, 12 Jan 2000, Tim Waugh wrote:

>This patch from Bert De Jonghe avoids a memcpy when it isn't needed.
>Since parport_pc.c is used by several architectures, should this be
>protected with #ifdef __i386__? I'm not sure if architectures like Sparc
>or Alpha have the same DMA limitation.

You shouldn't check against a 0x1000000L but you should check against
MAX_DMA_ADDRESS. BTW, you should compare with > and not >= ;).

You should change the code this way:

[..]
if (buf+length <= MAX_DMA_ADDRESS)
dma_addr = virt_to_bus(buf);
else
dma_addr = virt_to_bus(priv->dma_buf);
[..]

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/