From patchwork Wed Aug 26 12:18:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 11738299 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 0AEDC138A for ; Wed, 26 Aug 2020 12:19:02 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D44EC2080C for ; Wed, 26 Aug 2020 12:19:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D44EC2080C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 62E54123F3553; Wed, 26 Aug 2020 05:19:01 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=45.249.212.191; helo=huawei.com; envelope-from=yuehaibing@huawei.com; receiver= Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2C278123F0FE3 for ; Wed, 26 Aug 2020 05:18:59 -0700 (PDT) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6307F1CE024FDD78DF13; Wed, 26 Aug 2020 20:18:55 +0800 (CST) Received: from localhost (10.174.179.108) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 26 Aug 2020 20:18:44 +0800 From: YueHaibing To: , , , , Subject: [PATCH] libnvdimm/e820: Fix build error without MEMORY_HOTPLUG Date: Wed, 26 Aug 2020 20:18:00 +0800 Message-ID: <20200826121800.732-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.108] X-CFilter-Loop: Reflected Message-ID-Hash: E7Q7F3MRXOH5H2QSPSFJGIAKICCXJL5I X-Message-ID-Hash: E7Q7F3MRXOH5H2QSPSFJGIAKICCXJL5I X-MailFrom: yuehaibing@huawei.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, YueHaibing X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: If MEMORY_HOTPLUG is n, build fails: drivers/nvdimm/e820.c: In function ‘e820_register_one’: drivers/nvdimm/e820.c:24:12: error: implicit declaration of function ‘phys_to_target_node’; did you mean ‘set_page_node’? [-Werror=implicit-function-declaration] int nid = phys_to_target_node(res->start); ^~~~~~~~~~~~~~~~~~~ set_page_node Fixes: 7b27a8622f80 ("libnvdimm/e820: Retrieve and populate correct 'target_node' info") Signed-off-by: YueHaibing Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: kernel test robot --- drivers/nvdimm/e820.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/nvdimm/e820.c b/drivers/nvdimm/e820.c index 4cd18be9d0e9..c741f029f215 100644 --- a/drivers/nvdimm/e820.c +++ b/drivers/nvdimm/e820.c @@ -17,6 +17,13 @@ static int e820_pmem_remove(struct platform_device *pdev) return 0; } +#ifndef CONFIG_MEMORY_HOTPLUG +static inline int phys_to_target_node(u64 start) +{ + return 0; +} +#endif + static int e820_register_one(struct resource *res, void *data) { struct nd_region_desc ndr_desc;