From patchwork Wed Mar 18 21:33:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 11446121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3D1A13B1 for ; Wed, 18 Mar 2020 21:33:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AEE87208CA for ; Wed, 18 Mar 2020 21:33:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ix5Z/nym" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEE87208CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E1C6F6B009A; Wed, 18 Mar 2020 17:33:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DCC756B009B; Wed, 18 Mar 2020 17:33:25 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE2DE6B009C; Wed, 18 Mar 2020 17:33:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id B28876B009A for ; Wed, 18 Mar 2020 17:33:25 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 663A54DB8 for ; Wed, 18 Mar 2020 21:33:25 +0000 (UTC) X-FDA: 76609784370.19.birth07_1dda9e7507a08 X-Spam-Summary: 2,0,0,7fc281bf28d3c88f,d41d8cd98f00b204,rdunlap@infradead.org,,RULES_HIT:41:152:355:379:800:854:960:973:988:989:1260:1277:1311:1313:1314:1345:1381:1437:1515:1516:1518:1535:1543:1593:1594:1711:1730:1747:1777:1792:1801:2393:2559:2562:2689:3138:3139:3140:3141:3142:3353:3866:3870:3871:4321:4605:5007:6261:6653:7576:7875:9010:9121:9149:10004:10400:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12986:13894:14181:14394:14721:21080:21451:21627:21660:30054,0,RBL:198.137.202.133:@infradead.org:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: birth07_1dda9e7507a08 X-Filterd-Recvd-Size: 5068 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Mar 2020 21:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc: Content-ID:Content-Description:In-Reply-To:References; bh=7C99gg0dFQ88jekGFXdIQKCeI7+noYOSr4It/4IKhXs=; b=ix5Z/nym4gWSAkSZ3dwnCjogYk g5HR2B8EKYlPJK4VmyBlhL7mGkwQG3+OmTvnXENcd19BI/COJXrw0nvngsrx68Uxd94L9l/y3s2sy Nn6BZjIZAzT/UgoHNldFa6UrSGGbHygCxL713OcmqBp7g9RwCy46xDTYDHRksUdAOrtUjQoR6oT+w SAtYLEuiHIuGTs0GRPNQsvrb65dUWWmvrL9nARiblnFNgyuD6yF+/ZPTiT+YU4o2bRDhk2x9W7Ej+ fNR6Pjn2EUy0rGQn/b2Im/K3KWNmuib8j3OJSfuKI1m5jIOkyTvIfTQkig/3ZEAHxIdSKSZRcEeaG L5yHMdog==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEgJU-0007sv-7q; Wed, 18 Mar 2020 21:33:20 +0000 To: Linux MM , Andrew Morton , LKML From: Randy Dunlap Subject: [PATCH -next] mm/hugetlb.c: fix printk format warning for 32-bit phys_addr_t Message-ID: Date: Wed, 18 Mar 2020 14:33:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Randy Dunlap Fix printk format warnings when phys_addr_t is 32 bits, i.e., CONFIG_PHYS_ADDR_T_64BIT is not set/enabled. Fixes these build warnings: CC mm/hugetlb.o In file included from ../include/linux/printk.h:7:0, from ../include/linux/kernel.h:15, from ../include/linux/list.h:9, from ../mm/hugetlb.c:6: ../mm/hugetlb.c: In function ‘hugetlb_cma_reserve’: ../include/linux/kern_levels.h:5:18: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ ../include/linux/kern_levels.h:12:22: note: in expansion of macro ‘KERN_SOH’ #define KERN_WARNING KERN_SOH "4" /* warning conditions */ ^~~~~~~~ ../include/linux/printk.h:306:9: note: in expansion of macro ‘KERN_WARNING’ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~ ../mm/hugetlb.c:5472:4: note: in expansion of macro ‘pr_warn’ pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%llu, %llu)", ^~~~~~~ ../mm/hugetlb.c:5472:67: note: format string is defined here pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%llu, %llu)", ~~~^ %u In file included from ../include/linux/printk.h:7:0, from ../include/linux/kernel.h:15, from ../include/linux/list.h:9, from ../mm/hugetlb.c:6: ../include/linux/kern_levels.h:5:18: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘unsigned int’ [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ ../include/linux/kern_levels.h:12:22: note: in expansion of macro ‘KERN_SOH’ #define KERN_WARNING KERN_SOH "4" /* warning conditions */ ^~~~~~~~ ../include/linux/printk.h:306:9: note: in expansion of macro ‘KERN_WARNING’ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~ ../mm/hugetlb.c:5472:4: note: in expansion of macro ‘pr_warn’ pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%llu, %llu)", ^~~~~~~ ../mm/hugetlb.c:5472:73: note: format string is defined here pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%llu, %llu)", ~~~^ %u Signed-off-by: Randy Dunlap --- mm/hugetlb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- linux-next-20200318.orig/mm/hugetlb.c +++ linux-next-20200318/mm/hugetlb.c @@ -5469,8 +5469,10 @@ void __init hugetlb_cma_reserve(int orde 0, false, "hugetlb", &hugetlb_cma[nid]); if (res) { - pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%llu, %llu)", - res, nid, PFN_PHYS(min_pfn), PFN_PHYS(max_pfn)); + phys_addr_t begpa = PFN_PHYS(min_pfn); + phys_addr_t endpa = PFN_PHYS(max_pfn); + pr_warn("hugetlb_cma: reservation failed: err %d, node %d, [%pap, %pap)", + res, nid, &begpa, &endpa); break; }