[PATCH 14/21] Introduce EEH device

Stephen Rothwell sfr at canb.auug.org.au
Fri Feb 24 23:50:12 EST 2012


Hi Gavin,

On Fri, 24 Feb 2012 17:38:11 +0800 Gavin Shan <shangw at linux.vnet.ibm.com> wrote:
>
> diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h
> index d57c08a..4668344 100644
> --- a/arch/powerpc/include/asm/device.h
> +++ b/arch/powerpc/include/asm/device.h
> @@ -31,6 +31,9 @@ struct dev_archdata {
>  #ifdef CONFIG_SWIOTLB
>  	dma_addr_t		max_direct_dma_addr;
>  #endif
> +#ifdef CONFIG_EEH
> +	void			*edev;
> +#endif
>  };
>  
>  struct pdev_archdata {
> diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
> index ad8f318..1310971 100644
> --- a/arch/powerpc/include/asm/eeh.h
> +++ b/arch/powerpc/include/asm/eeh.h
> +#define OF_NODE_TO_EEH_DEV(dn)		((struct eeh_dev *)(dn->edev))
> +#define PCI_DEV_TO_EEH_DEV(pdev)	((struct eeh_dev *)(pdev->dev.archdata.edev))

If the edev fields of dev_archdata and device_node are always going to be
"struct eeh_dev *", why not declare then as such and avoid the casting?

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20120224/014d1e71/attachment.pgp>


More information about the Linuxppc-dev mailing list