[U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

Guennadi Liakhovetski g.liakhovetski at gmx.de
Fri Sep 11 13:00:42 CEST 2009


Hi Wolfgang

On Fri, 11 Sep 2009, Wolfgang Denk wrote:

> Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> 
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> Cc: Guennadi Liakhovetski <lg at denx.de>
> ---
>  board/linkstation/ide.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
> index 2c89d62..5dd1d0e 100644
> --- a/board/linkstation/ide.c
> +++ b/board/linkstation/ide.c
> @@ -54,10 +54,12 @@ int ide_preinit (void)
>  	if (devbusfn == -1)
>  		devbusfn = pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
>  	if (devbusfn != -1) {
> +		ulong *ide_bus_offset_ptr = &ide_bus_offset[0];
> +
>  		status = 0;
>  
>  		pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
> -							   (u32 *) &ide_bus_offset[0]);
> +							   (u32 *)ide_bus_offset_ptr);

Can we also use this occasion to get rid of this typecast?

>  		ide_bus_offset[0] &= 0xfffffffe;
>  		ide_bus_offset[0] = pci_hose_bus_to_phys(&hose,
>  							 ide_bus_offset[0] & 0xfffffffe,
> -- 
> 1.6.0.6

Thanks
Guennadi
---
Guennadi Liakhovetski


More information about the U-Boot mailing list