linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: David Binderman <linuxdev.baldrick@gmail.com>
Cc: benh@kernel.crashing.org, paulus@samba.org,
	linuxppc-dev@lists.ozlabs.org,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dcb314@hotmail.com
Subject: Re: arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ?
Date: Tue, 28 Jun 2016 17:17:59 +1000	[thread overview]
Message-ID: <1467098279.28062.8.camel@ellerman.id.au> (raw)
In-Reply-To: <CAMzoambZ9wu3orkFfYemTQiMpf+OWPdk8v6_SXsJapS74HE13A@mail.gmail.com>

On Tue, 2016-06-28 at 08:06 +0100, David Binderman wrote:
> On Tue, Jun 28, 2016 at 5:08 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > What config / toolchain are you using? I've never seen these.
> 
> A static analyser for C & C++ called cppcheck. Available from sourceforge.
> 
> I think you can also get a similar warning if you tweek the gcc compiler warning
> flags. -Wformat=2 maybe.
 
Ah OK. I've heard of it.

> > > static inline int print_insn_powerpc(unsigned long insn, unsigned long memaddr)
> > > {
> > >     printf("%.8x", insn);
> > >     return 0;
> > > }
> > 
> > Send me a patch to cast insn to unsigned int?
> 
> I don't know the code, but given that insn is unsigned long and so can go
> past 32 bits, using a cast to unsigned int might throw away the
> possibly important upper bits.

powerpc instructions are always 32-bit.

We could change the signature for the function to take u32. Except it's the
fallback implementation for the real version which comes from binutils and we'd
prefer to keep that code the same as the binutils version.

cheers

  reply	other threads:[~2016-06-28  7:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27  8:04 arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ? David Binderman
2016-06-28  4:08 ` Michael Ellerman
2016-06-28  7:06   ` David Binderman
2016-06-28  7:17     ` Michael Ellerman [this message]
2016-06-28  7:30     ` Segher Boessenkool
2016-06-28  9:35     ` Benjamin Herrenschmidt

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=1467098279.28062.8.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=dcb314@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxdev.baldrick@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    /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;
as well as URLs for NNTP newsgroup(s).