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

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Jan 12 2000 - 18:32:12 EST


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/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:21 EST