From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752115AbcF1HSJ (ORCPT ); Tue, 28 Jun 2016 03:18:09 -0400 Received: from ozlabs.org ([103.22.144.67]:51686 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753AbcF1HSH (ORCPT ); Tue, 28 Jun 2016 03:18:07 -0400 Message-ID: <1467098279.28062.8.camel@ellerman.id.au> Subject: Re: arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ? From: Michael Ellerman To: David Binderman Cc: benh@kernel.crashing.org, paulus@samba.org, linuxppc-dev@lists.ozlabs.org, Linux Kernel Mailing List , dcb314@hotmail.com Date: Tue, 28 Jun 2016 17:17:59 +1000 In-Reply-To: References: <1467086888.32607.9.camel@ellerman.id.au> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-06-28 at 08:06 +0100, David Binderman wrote: > On Tue, Jun 28, 2016 at 5:08 AM, Michael Ellerman 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