Re: How to map high memory for block io

Russell King
2006-03-02T11:45:33Z

On Thu, Mar 02, 2006 at 11:26:13AM +0100, Pierre Ossman wrote:
> This I know. My beef is the readability of:
>
> if (do_dma)
> *dev->dma_mask = DEVICE_DMA_MASK;
> else
> *dev->dma_mask = 0;
>
> I.e. we use dma_mask even though we don't do DMA.

Not a lot we can do about the readability issue - we end up with code
like that in some layer of the MMC. If it's in mmc_queue, it might be:

u64 limit = BLK_BOUNCE_HIGH;

if (host->caps & MMC_CAP_DMA &&
host->dev->dma_mask && *host->dev->dma_mask)
limit = *host->dev->dma_mask;

which is equally as (un)readable as your code.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core