[parisc-linux-cvs] [PATCH] ccio-dma cleanups and kernel documentation

Grant Grundler grundler@puffin.external.hp.com
Wed, 29 Aug 2001 15:00:00 -0600


Ryan Bradetich wrote:
>  static int
> -ccio_alloc_range(struct ioc *ioc, size_t size)
> +ccio_alloc_range(struct ioc *ioc, unsigned long pages_needed)

This change has me nervous.

> -	idx = ccio_alloc_range(ioc, size);
> +	idx = ccio_alloc_range(ioc, (size >> IOVP_SHIFT));

I didn't walk through the code but it seems like we lost a corner case
of when an address starts on something other than a page boundary
and crosses the next page boundary.

> -			| (ccio_alloc_range(ioc, dma_len) << IOVP_SHIFT)
> +			| (ccio_alloc_range(ioc, (dma_len >> IOVP_SHIFT)) << IO
>   VP_SHIFT)

This should just be a mask operation (drop lower bits).

grant

Grant Grundler
parisc-linux {PCI|IOMMU|SMP} hacker
+1.408.447.7253