public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning
Date: Wed, 17 Jun 2009 22:14:28 -0700	[thread overview]
Message-ID: <4A39CD34.4070108@gmail.com> (raw)
In-Reply-To: <20090615115033.94ba02d2.kim.phillips@freescale.com>

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.phillips@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

  reply	other threads:[~2009-06-18  5:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 16:50 [U-Boot] [PATCH] net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning Kim Phillips
2009-06-18  5:14 ` Ben Warren [this message]
     [not found]   ` <2acbd3e40906181519h8c14828pf167c0c197a6e828@mail.gmail.com>
     [not found]     ` <4A56D89D.2040900@gmail.com>
2009-07-17 17:17       ` [U-Boot] [PATCH v2] " Kim Phillips
2009-07-21  4:49         ` Ben Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A39CD34.4070108@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox