Kim Phillips wrote:
> fix this gcc 4.4 warning:
>
> tsec.c: In function 'tsec_init':
> tsec.c:200: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
>
> Signed-off-by: Kim Phillips <kim.phill...@freescale.com>
> ---
>  drivers/net/tsec.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index 399116f..40b3be4 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -197,7 +197,10 @@ int tsec_init(struct eth_device *dev, bd_t * bd)
>       for (i = 0; i < MAC_ADDR_LEN; i++) {
>               tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->enetaddr[i];
>       }
> -     regs->macstnaddr1 = *((uint *) (tmpbuf));
> +     tempval = (tmpbuf[3] << 24) | (tmpbuf[2] << 16) | (tmpbuf[1] << 8) |
> +               tmpbuf[0];
> +
> +     regs->macstnaddr1 = tempval;
>  
>       tempval = *((uint *) (tmpbuf + 4));
>  
>   
Applied to net repo.

thanks,
Ben

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to