From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753367AbcD2ODr (ORCPT ); Fri, 29 Apr 2016 10:03:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752764AbcD2ODr (ORCPT ); Fri, 29 Apr 2016 10:03:47 -0400 Date: Fri, 29 Apr 2016 09:03:42 -0500 From: Josh Poimboeuf To: Stephen Rothwell Cc: Andrew Morton , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Quinn Tran Subject: Re: linux-next: build warning after merge of the akpm-current tree Message-ID: <20160429140342.ygb477u36ajmcoax@treble> References: <20160429164543.039df436@canb.auug.org.au> <20160429133219.bhu3picl6jwxdedj@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160429133219.bhu3picl6jwxdedj@treble> User-Agent: Mutt/1.6.0.1 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 29, 2016 at 08:32:19AM -0500, Josh Poimboeuf wrote: > On Fri, Apr 29, 2016 at 04:45:43PM +1000, Stephen Rothwell wrote: > > Hi Andrew, > > > > After merging the akpm-current tree, today's linux-next build (x86_64 > > allmodconfig) produced this warning: > > > > drivers/scsi/ipr.c: In function 'ipr_show_device_id': > > drivers/scsi/ipr.c:4462:34: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=] > > len = snprintf(buf, PAGE_SIZE, "0x%llx\n", be64_to_cpu(res->dev_id)); > > ^ > > > > Lots and lots like this :-( > > > > Probably introduced by commit > > > > eef17fb79096 ("byteswap: try to avoid __builtin_constant_p gcc bug") > > > > I guess __builtin_bswap64() has type "unsigned long int" :-( > > Hm, I suppose this is cross-compiled on a powerpc host? > > We probably need to add a (__u64) cast to the return value of > __builtin_bswap64(), like: > > diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h > index de56fd5..d737804 100644 > --- a/include/uapi/linux/swab.h > +++ b/include/uapi/linux/swab.h > @@ -123,7 +123,7 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val) > * @x: value to byteswap > */ > #ifdef __HAVE_BUILTIN_BSWAP64__ > -#define __swab64(x) __builtin_bswap64((__u64)(x)) > +#define __swab64(x) (__u64)__builtin_bswap64((__u64)(x)) > #else > #define __swab64(x) \ > (__builtin_constant_p((__u64)(x)) ? \ Never mind about cross-compiling on powerpc, this has nothing to do with that. But the above patch does seem to fix it. -- Josh