public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dm: ppc: Fixup cpu.c warning in mpc8xx
Date: Fri, 27 Jul 2012 22:56:44 +0200	[thread overview]
Message-ID: <20120727205644.5DCDC203AC0@gemini.denx.de> (raw)
In-Reply-To: <1343419212-18716-1-git-send-email-marex@denx.de>

Dear Marek Vasut,

In message <1343419212-18716-1-git-send-email-marex@denx.de> you wrote:
> cpu.c: In function ?check_CPU?:
> cpu.c:256:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  arch/powerpc/cpu/mpc8xx/cpu.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
...
> -	k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
> +	k = (immr << 16) | readw(&immap->im_cpm.cp_dparam[0xB0]);

I think this is wrong.  readw() is a little endian I/O accessor, but
PPC is all big-endian.

Guess this was untested?

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
"The good Christian should beware of mathematicians and all those who
make empty prophecies. The danger already exists that  mathematicians
have  made a covenant with the devil to darken the spirit and confine
man in the bonds of Hell."                          - Saint Augustine

  reply	other threads:[~2012-07-27 20:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 20:00 [U-Boot] [PATCH] dm: ppc: Fixup cpu.c warning in mpc8xx Marek Vasut
2012-07-27 20:56 ` Wolfgang Denk [this message]
2012-07-27 21:26   ` Marek Vasut
2012-07-27 22:14     ` Wolfgang Denk
2012-07-27 22:29       ` Marek Vasut
2012-07-27 22:57 ` [U-Boot] [PATCH V2] " Marek Vasut
2012-07-30  7:45   ` Wolfgang Denk
2012-07-30  8:02   ` 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=20120727205644.5DCDC203AC0@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