[PATCH2 02/22] staging: brcm80211: Remove abstraction of pci_(alloc/free)_consistent

Jiri Slaby jirislaby at gmail.com
Tue Mar 1 10:45:30 UTC 2011


On 02/25/2011 04:39 PM, Arend van Spriel wrote:
> --- a/drivers/staging/brcm80211/util/hnddma.c
> +++ b/drivers/staging/brcm80211/util/hnddma.c
> @@ -32,6 +32,10 @@
>  #include <asm/addrspace.h>
>  #endif
>  
> +#ifdef BRCM_FULLMAC
> +#error "hnddma.c shouldn't be needed for FULLMAC"
> +#endif
> +
>  /* debug/trace */
>  #ifdef BCMDBG
>  #define	DMA_ERROR(args) \
> @@ -527,6 +531,18 @@ static bool _dma_alloc(dma_info_t *di, uint direction)
>  	return dma64_alloc(di, direction);
>  }
>  
> +void *dma_alloc_consistent(struct osl_info *osh, uint size, u16 align_bits,

Gak. This is too global to be named that way. And if it wasn't global,
the name will be too generic still.

> +			       uint *alloced, unsigned long *pap)
> +{
> +	if (align_bits) {
> +		u16 align = (1 << align_bits);
> +		if (!IS_ALIGNED(PAGE_SIZE, align))
> +			size += align;
> +		*alloced = size;
> +	}
> +	return pci_alloc_consistent(osh->pdev, size, (dma_addr_t *) pap);

You should use dma_alloc_consistent instead anyway.

regards,
-- 
js



More information about the devel mailing list