Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4326505pxb; Mon, 1 Feb 2021 19:53:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOMvKXx1H80MmNY5aQdQdjX3620mOBPRceLKYE4Jmnt2Izj2ubphNesm0ABBDaj2GAzKUn X-Received: by 2002:a17:907:1119:: with SMTP id qu25mr20683197ejb.268.1612238038095; Mon, 01 Feb 2021 19:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612238038; cv=none; d=google.com; s=arc-20160816; b=PqL2pzwpBOg0g8WXZ6s/FdMAGoUrjtklXADcAVsK56CZCf390J7tWCFNol2LYkT/hr /RxnjPDwdDx4CbzqP2oypC2dAYg5dT1rGoPg560eiJtvjwXhGd2sxMQArbtCeqSGijnl L0laKcQfga/ruNhTuCUrG7LQc73jPbtH/6NSZRqzwGPlOysE/9X0SCHQlzrlpGtMGGog 9iYyVFbj9trQvvRBSzo4PrYui9UuYvtwSQ3xCavCG/EHywA1aUMBhCfU5ezNBAZts7DF geeEf1k14qkFj4vV9FzrKx1HpSFwrPXIyqxDj3H/8vE8CK/DeNyhiEUPx75WXwWe5tvk Z1YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ULgMFWwk3TvS5KArsELEwceUudzpxXJ2XabGwJIlDsw=; b=r11hIQaNDbOe/8jgokJnN3NXKGIJ/uWhWKEA4tjwWsHnT+fADxkZHjmtczWiOw7QJ0 1xUAsl0T/tWK9hdN/tn7URL45YU24Yv6qwIj1oY2YAO/yWIHpxuMTBppOqeq/MtV9hHL AzPcmtJw4Q6zYzzDmJuYAE71roGG6+Qo3fNuurk9azrA+k+QRhpMz/7AwrYKetMgSMHm YQ6APSw8pXn4g0EXFEXd54TknpIG+ct7pW7pkrXTauvWXKNhlbLqIVCyqkTN6VL40Itm 9cgT9dXk6Xif0WrwFR1yqD+tjbksOkINv4UKO44TqfwhOEU1vaC6bDu1NkOB5OpxNeXh 1TiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=1KJd+oZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si12249985edq.199.2021.02.01.19.53.34; Mon, 01 Feb 2021 19:53:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=1KJd+oZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbhBBDwC (ORCPT + 99 others); Mon, 1 Feb 2021 22:52:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231423AbhBBDv7 (ORCPT ); Mon, 1 Feb 2021 22:51:59 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D959AC061573 for ; Mon, 1 Feb 2021 19:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=ULgMFWwk3TvS5KArsELEwceUudzpxXJ2XabGwJIlDsw=; b=1KJd+oZWsqE3ryTB2rApTwsozI cCXW5V1d7iCAc2pVHteHzrSBZnLuDOfm3Ek4+eV6euwXjkaO1Taei1Dh9JBHf07JUHtRm0sav3Ye0 r5RQQRUkPh8PN8mdwVY7htTUFhi19odDK0WUfg+opzYowC0d9U4+XxjEfPI03QFR7FdDZA8xsXutc YR8NheeSiBB9jD2UdZmRUHo83waguigTXs3T6TjUUlaSP/AEcZJNkhlfB4OrWdK16HLpJTx4N9pvc ICvuYh9EtT+9x5uhDowmxwYadNlS8Pb9ZZInrgPrCKVPhKVrnf4fYisiAK3XOhUMwvJCF32Zr4JVj w79OR71w==; Received: from [2601:1c0:6280:3f0::2a53] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6mie-0001Mo-1C; Tue, 02 Feb 2021 03:51:12 +0000 Subject: Re: [PATCH] arch_numa: fix common code printing of phys_addr_t To: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org, lkp@intel.com, Atish Patra References: From: Randy Dunlap Message-ID: <0d6fb1da-6b14-7f54-3f4c-4697c88a14f7@infradead.org> Date: Mon, 1 Feb 2021 19:51:07 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/1/21 7:36 PM, Palmer Dabbelt wrote: > On Wed, 27 Jan 2021 19:55:33 PST (-0800), rdunlap@infradead.org wrote: >> Fix build warnings in the arch_numa common code: >> >> ../include/linux/kern_levels.h:5:18: warning: format '%Lx' expects argument of type 'long long unsigned int', but argument 3 has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=] >> ../drivers/base/arch_numa.c:360:56: note: format string is defined here >>   360 |    pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n", >> ../drivers/base/arch_numa.c:435:39: note: format string is defined here >>   435 |  pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n", start, end - 1); >> >> Fixes: ae3c107cd8be ("numa: Move numa implementation to common code") >> Signed-off-by: Randy Dunlap >> Reported-by: kernel test robot >> Cc: Atish Patra >> Cc: Palmer Dabbelt >> --- >>  drivers/base/arch_numa.c |   13 +++++++------ >>  1 file changed, 7 insertions(+), 6 deletions(-) >> >> --- linux-next-20210125.orig/drivers/base/arch_numa.c >> +++ linux-next-20210125/drivers/base/arch_numa.c >> @@ -355,11 +355,12 @@ static int __init numa_register_nodes(vo >>      /* Check that valid nid is set to memblks */ >>      for_each_mem_region(mblk) { >>          int mblk_nid = memblock_get_region_node(mblk); >> +        phys_addr_t start = mblk->base; >> +        phys_addr_t end = mblk->base + mblk->size - 1; >> >>          if (mblk_nid == NUMA_NO_NODE || mblk_nid >= MAX_NUMNODES) { >> -            pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n", >> -                mblk_nid, mblk->base, >> -                mblk->base + mblk->size - 1); >> +            pr_warn("Warning: invalid memblk node %d [mem %pap-%pap]\n", >> +                mblk_nid, &start, &end); >>              return -EINVAL; >>          } >>      } >> @@ -427,14 +428,14 @@ out_free_distance: >>  static int __init dummy_numa_init(void) >>  { >>      phys_addr_t start = memblock_start_of_DRAM(); >> -    phys_addr_t end = memblock_end_of_DRAM(); >> +    phys_addr_t end = memblock_end_of_DRAM() - 1; >>      int ret; >> >>      if (numa_off) >>          pr_info("NUMA disabled\n"); /* Forced off on command line. */ >> -    pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n", start, end - 1); >> +    pr_info("Faking a node at [mem %pap-%pap]\n", &start, &end); >> >> -    ret = numa_add_memblk(0, start, end); >> +    ret = numa_add_memblk(0, start, end + 1); >>      if (ret) { >>          pr_err("NUMA init failed\n"); >>          return ret; > > Thanks, this is on for-next.  Did you, by any chance, find %Lx documented > anywhere?  It's not ISO C and the GCC source code says it's a GNU extension, > but I couldn't find it in the documentation (or even where to add it, which I > guess is how I forgot to send my version fo the patch). 'man sprintf' says this: As a nonstandard extension, the GNU implementations treats ll and L as synonyms, so that one can, for example, write llg (as a synonym for the standards-compliant Lg) and Ld (as a synonym for the standards compli- ant lld). Such usage is nonportable. and linux/lib/vsprintf.c has some handling for it: if (qualifier == 'L') spec->type = FORMAT_TYPE_LONG_LONG; and case 'L': if (is_sign) *va_arg(args, long long *) = val.s; else *va_arg(args, unsigned long long *) = val.u; break; Does that help? -- ~Randy