From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] macb: fix compile warning
Date: Wed, 27 Jul 2011 23:48:56 +0200 [thread overview]
Message-ID: <20110727214856.DFB671EA343@gemini.denx.de> (raw)
In-Reply-To: <1307619188-18655-1-git-send-email-andreas.devel@gmail.com>
Dear "=?UTF-8?q?Andreas=20Bie=C3=9Fmann?=",
In message <1307619188-18655-1-git-send-email-andreas.devel@gmail.com> you wrote:
> This patch fixes following compile warning:
>
> ---8<---
> macb.c: In function 'macb_write_hwaddr':
> macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
> --->8---
>
> Signed-off-by: Andreas Bie??mann <andreas.devel@gmail.com>
> ---
> BEWARE! this patch is only copile tested!
>
> drivers/net/macb.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 72ea1fc..da41054 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
> u16 hwaddr_top;
>
> /* set hardware address */
> - hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
> + hwaddr_bottom = netdev->enetaddr[0] | netdev->enetaddr[1] << 8 |
> + netdev->enetaddr[2] << 16 | netdev->enetaddr[3] << 24;
> macb_writel(macb, SA1B, hwaddr_bottom);
> - hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
> + hwaddr_top = netdev->enetaddr[4] | netdev->enetaddr[5] << 8;
> macb_writel(macb, SA1T, hwaddr_top);
> return 0;
This doesn't apply. Can you please rebase and resubmit? Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"355/113 -- Not the famous irrational number PI, but an incredible
simulation!"
next prev parent reply other threads:[~2011-07-27 21:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 11:33 [U-Boot] [PATCH] macb: fix compile warning Andreas Bießmann
2011-06-09 12:08 ` [U-Boot] [PATCH v2] " Andreas Bießmann
2011-06-09 19:02 ` Reinhard Meyer
2011-07-27 21:48 ` Wolfgang Denk [this message]
2011-07-27 21:55 ` [U-Boot] [PATCH] " Reinhard Meyer
2011-07-27 22:06 ` Wolfgang Denk
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=20110727214856.DFB671EA343@gemini.denx.de \
--to=wd@denx.de \
--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