Re: How to map high memory for block io

From: Russell King
Date: Thu Mar 02 2006 - 06:43:16 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/