Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757170AbcKXRI4 (ORCPT ); Thu, 24 Nov 2016 12:08:56 -0500 Received: from smtprelay0088.hostedemail.com ([216.40.44.88]:33088 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752087AbcKXRIz (ORCPT ); Thu, 24 Nov 2016 12:08:55 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:152:355:379:541:599:800:960:968:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3622:3865:3866:3870:3871:3872:3874:4321:5007:8603:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12043:12296:12555:12740:12986:13069:13161:13229:13311:13357:13894:14181:14659:14721:19904:19999:21080:21451:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: cloud25_3052b89f02f32 X-Filterd-Recvd-Size: 2183 Message-ID: <1480007330.19726.11.camel@perches.com> Subject: Re: [PATCH] z3fold: use %z modifier for format string From: Joe Perches To: Arnd Bergmann , Andrew Morton Cc: Vitaly Wool , Dan Streetman , zhong jiang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 24 Nov 2016 09:08:50 -0800 In-Reply-To: <20161124163158.3939337-1-arnd@arndb.de> References: <20161124163158.3939337-1-arnd@arndb.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1287 Lines: 31 On Thu, 2016-11-24 at 17:31 +0100, Arnd Bergmann wrote: > Printing a size_t requires the %zd format rather than %d: > > mm/z3fold.c: In function ‘init_z3fold’: > include/linux/kern_levels.h:4:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] > > Fixes: 50a50d2676c4 ("z3fold: don't fail kernel build if z3fold_header is too big") > Signed-off-by: Arnd Bergmann > --- > mm/z3fold.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/z3fold.c b/mm/z3fold.c > index e282ba073e77..66ac7a7dc934 100644 > --- a/mm/z3fold.c > +++ b/mm/z3fold.c > @@ -884,7 +884,7 @@ static int __init init_z3fold(void) > { > /* Fail the initialization if z3fold header won't fit in one chunk */ > if (sizeof(struct z3fold_header) > ZHDR_SIZE_ALIGNED) { > - pr_err("z3fold: z3fold_header size (%d) is bigger than " > + pr_err("z3fold: z3fold_header size (%zd) is bigger than " > "the chunk size (%d), can't proceed\n", > sizeof(struct z3fold_header) , ZHDR_SIZE_ALIGNED); > return -E2BIG; The embedded "z3fold: " prefix here should be removed as there's a pr_fmt that also adds it. The test looks like it should be a BUILD_BUG_ON rather than any runtime test too.