From patchwork Thu Jan 31 16:10:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 157145 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7389552jaa; Thu, 31 Jan 2019 08:11:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN44e8KQR+5Uw4le+kj8wEqY6Ydl+B+7xvt9HXPaqcPXeik5J7nuqh6Jz8WGGwns5fpkWOZQ X-Received: by 2002:a63:c64f:: with SMTP id x15mr31212273pgg.16.1548951066525; Thu, 31 Jan 2019 08:11:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548951066; cv=none; d=google.com; s=arc-20160816; b=FYHIwkPVJ/VB/7rw8F2exBFlyOEzlQ+78m9j5gmL2Ioo6gtbn+zqRVU3d+x9cbAdfY ufIhPr0i9PyVWoACdIIv7FgoxRrgfmYPclYABPL2gtFiCqrskAtQdwBp3ekPBLX32XES 2WRFDXIT+jtz2uRexioETpE+0Y5nm2oMcUEBMf846LLiK0rhAZsfACiOQbMqH3HifC32 TFIF6Y0KPeNjSJ8q2ng7MqV/ePunJNB2XCgzpSTQWF4tWs+JOuWZIQjLvPp4R9P+0LKS abX1VZJzLTrsB10mrgOng83Pw3sNMk2DtX2OQT1TS40S+dz9cq1Ixqj3bO7YCJ3LJm3S cR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=l8ZZE/CQHJf/B+Br/+OZnPG545feQjEVeVkqxdQKkp0=; b=JIV7aSK0RUtEh/l7hZ6wmxXDJBo+LHBmlUlve5uHLdG13T0RWH3Sr04HSY6ydpXIRV mxgPyA7I8JK88jyMXrqtuzBPJ4WGv5Eu/SHyd0YtGw9xFhpI7QThV/b9kEqMKRW+nTVW 1HMfX5LKcYJE6XazwRyenQRFBjn9NLJBlD+5MJ5+1YP1bYJsHp2mKCkIoWCWw0CyAEh5 W7Dh5HHi9UHkefm/m7QgFvekR23IvsMqwQcDFk7RyQHOt8BRoXcJk0QjAVfwWBsD59Vf 3oaz3fnBkm+CqWqHlG20E49RVCQRYAj1mVTHeCdDPE6OrYtx4dbj/Dzv07ZrZqiLz9x7 4BLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NulEkyw7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o68si5612774pfo.140.2019.01.31.08.11.06; Thu, 31 Jan 2019 08:11:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NulEkyw7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388152AbfAaQLE (ORCPT + 31 others); Thu, 31 Jan 2019 11:11:04 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38965 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbfAaQLD (ORCPT ); Thu, 31 Jan 2019 11:11:03 -0500 Received: by mail-lf1-f67.google.com with SMTP id n18so2739107lfh.6 for ; Thu, 31 Jan 2019 08:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l8ZZE/CQHJf/B+Br/+OZnPG545feQjEVeVkqxdQKkp0=; b=NulEkyw7WRGZfONt3e2rFzs9IFb84cAfNJcAgwD/UdiCtw/e5wReNIOU9KHl7SvheN 0I2NwQRGNpNE212NvAb3sBUsZi7MOhVHNSJviVZHs+BG9M6UVR3gV85ur9rCH1KMgKM/ f5fTxjcYk3zQnYAJC1Y/Gv+0HBQuJc+JJUGfE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l8ZZE/CQHJf/B+Br/+OZnPG545feQjEVeVkqxdQKkp0=; b=IIWTY516psBIQQr+w/h58WLtifpCs33oS3WB2CJp+Y4Qn0KvlywK6ZbybWynRf2HNG eIb2F+zsCUFGnq3MuMV415hAMttD2ranTWODP93WIZHX/jPXeHS0o3zN7VjPUIMlDzbZ 3YZ41EJ1nbvZq9lu2SBZ9Igq2zovIJXOnZ5EUK+lvPomPxvwAQZK3zP+eQzMUY54xz2x lkSvlOmDZcWb/z/7j3UpidmyJMoqfAshE5QfYpJKQlHt1Kb3ww2/nYexHhSnkM152GQf V1lYoutsS1Ppr3KtiGZxUCVF2gAXSKiJb0AmoUb332mnCRxWTBVt6cwJVmCxanfZ2S/i ciHQ== X-Gm-Message-State: AJcUukeGntH9vp7V6jXMTJS1i45K5KuOLOBpLvIyG3+SuemNGxL6OwDd ecyjOINZDBFproNigdIep8RoaovaanXD/g== X-Received: by 2002:a19:4345:: with SMTP id m5mr27334183lfj.142.1548951061287; Thu, 31 Jan 2019 08:11:01 -0800 (PST) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id z17sm324322lfh.9.2019.01.31.08.11.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 08:11:00 -0800 (PST) From: Anders Roxell To: akpm@linux-foundation.org Cc: rppt@linux.ibm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH] mm: sparse: Use '%pa' with 'phys_addr_t' type Date: Thu, 31 Jan 2019 17:10:46 +0100 Message-Id: <20190131161046.21886-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following build warning: mm/sparse.c: In function ‘sparse_buffer_init’: mm/sparse.c:438:69: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘phys_addr_t’ {aka ‘long long unsigned int’} [-Wformat=] panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%lx\n", ~~^ Rework to use '%pa' and not '%lx'. Use a local variable of phys_addr_t to print the reference with '%pa'. Fixes: 1c3c9328cde0 ("treewide: add checks for the return value of memblock_alloc*()") Signed-off-by: Anders Roxell --- mm/sparse.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/mm/sparse.c b/mm/sparse.c index 1471f06c6468..6a2b0a9359d7 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -409,16 +409,17 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid, { unsigned long size = section_map_size(); struct page *map = sparse_buffer_alloc(size); + phys_addr_t addr = __pa(MAX_DMA_ADDRESS); if (map) return map; map = memblock_alloc_try_nid(size, - PAGE_SIZE, __pa(MAX_DMA_ADDRESS), + PAGE_SIZE, addr, MEMBLOCK_ALLOC_ACCESSIBLE, nid); if (!map) - panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%lx\n", - __func__, size, PAGE_SIZE, nid, __pa(MAX_DMA_ADDRESS)); + panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%pa\n", + __func__, size, PAGE_SIZE, nid, &addr); return map; } @@ -429,14 +430,15 @@ static void *sparsemap_buf_end __meminitdata; static void __init sparse_buffer_init(unsigned long size, int nid) { + phys_addr_t addr = __pa(MAX_DMA_ADDRESS); WARN_ON(sparsemap_buf); /* forgot to call sparse_buffer_fini()? */ sparsemap_buf = memblock_alloc_try_nid_raw(size, PAGE_SIZE, - __pa(MAX_DMA_ADDRESS), + addr, MEMBLOCK_ALLOC_ACCESSIBLE, nid); if (!sparsemap_buf) - panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%lx\n", - __func__, size, PAGE_SIZE, nid, __pa(MAX_DMA_ADDRESS)); + panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%pa\n", + __func__, size, PAGE_SIZE, nid, &addr); sparsemap_buf_end = sparsemap_buf + size; }