Re: [PATCH 05/31] Constify struct dma_map_ops for 2.6.32 v1

From: Stephen Rothwell
Date: Fri Dec 04 2009 - 19:59:50 EST


Hi Emese,

On Fri, 04 Dec 2009 23:14:08 +0100 Emese Revfy <re.emese@xxxxxxxxx> wrote:
>
> --- a/arch/powerpc/kernel/vio.c
> +++ b/arch/powerpc/kernel/vio.c
> @@ -601,6 +601,7 @@ static void vio_dma_iommu_unmap_sg(struct device *dev,
> vio_cmo_dealloc(viodev, alloc_size);
> }
>
> +/* cannot be const */
> struct dma_map_ops vio_dma_mapping_ops = {

The problem with leaving this not const is that a pointer to it is later
assigned to an archdata::dma_ops which you have made into a const pointer
earlier in this patch. This will generate a warning which is fatal in
arch/powerpc as we compile that directory with -Werror.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature