From patchwork Sat Aug 29 00:16:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshi Kani X-Patchwork-Id: 7094051 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 811EC9F32B for ; Sat, 29 Aug 2015 00:18:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41ECA2066B for ; Sat, 29 Aug 2015 00:18:19 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F06F20664 for ; Sat, 29 Aug 2015 00:18:18 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D6454182C1D; Fri, 28 Aug 2015 17:18:17 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from g2t2354.austin.hp.com (g2t2354.austin.hp.com [15.217.128.53]) (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 BFC8A182C16 for ; Fri, 28 Aug 2015 17:18:16 -0700 (PDT) Received: from g2t2360.austin.hp.com (g2t2360.austin.hp.com [16.197.8.247]) by g2t2354.austin.hp.com (Postfix) with ESMTP id BC540303; Sat, 29 Aug 2015 00:18:15 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.78.168.61]) by g2t2360.austin.hp.com (Postfix) with ESMTP id E91223D; Sat, 29 Aug 2015 00:18:14 +0000 (UTC) From: Toshi Kani To: dan.j.williams@intel.com Subject: [PATCH] pmem, nfit: Fix ARCH_MEMREMAP_PMEM handling on x86_32 Date: Fri, 28 Aug 2015 18:16:06 -0600 Message-Id: <1440807366-31223-1-git-send-email-toshi.kani@hp.com> X-Mailer: git-send-email 2.4.3 Cc: linux-kernel@vger.kernel.org, hch@lst.de, linux-nvdimm@lists.01.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ARCH_MEMREMAP_PMEM is defined on x86_64 only per ARCH_HAS_PMEM_API. The following compile error in __nfit_spa_map() was observed on x86_32 as it refers ARCH_MEMREMAP_PMEM without #ifdef. drivers/acpi/nfit.c:1205:8: error: 'ARCH_MEMREMAP_PMEM' undeclared (first use in this function) Fix it by defining ARCH_MEMREMAP_PMEM to MEMREMAP_WT in when CONFIG_ARCH_HAS_PMEM_API is not set, i.e. x86_32. Remove '#ifdef ARCH_MEMREMAP_PMEM's that are no longer necessary with this change. Also remove the redundant definition of ARCH_MEMREMAP_PMEM in . Signed-off-by: Toshi Kani Cc: Dan Williams Cc: Ross Zwisler Cc: Christoph Hellwig ---- Apply on top of libnvdimm-for-next of the nvdimm tree. --- arch/x86/include/asm/pmem.h | 2 -- drivers/nvdimm/namespace_devs.c | 4 ---- include/linux/pmem.h | 6 +----- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index 5c8c753..5111f1f 100644 --- a/arch/x86/include/asm/pmem.h +++ b/arch/x86/include/asm/pmem.h @@ -18,8 +18,6 @@ #include #include -#define ARCH_MEMREMAP_PMEM MEMREMAP_WB - #ifdef CONFIG_ARCH_HAS_PMEM_API #define ARCH_MEMREMAP_PMEM MEMREMAP_WB /** diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 0955b2c..6b40e1c 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -90,11 +90,7 @@ bool pmem_should_map_pages(struct device *dev) if (is_nd_pfn(dev) || is_nd_btt(dev)) return false; -#ifdef ARCH_MEMREMAP_PMEM return ARCH_MEMREMAP_PMEM == MEMREMAP_WB; -#else - return false; -#endif } EXPORT_SYMBOL(pmem_should_map_pages); diff --git a/include/linux/pmem.h b/include/linux/pmem.h index ebf95a6..04eefc6 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h @@ -19,6 +19,7 @@ #ifdef CONFIG_ARCH_HAS_PMEM_API #include #else +#define ARCH_MEMREMAP_PMEM MEMREMAP_WT /* * These are simply here to enable compilation, all call sites gate * calling these symbols with arch_has_pmem_api() and redirect to the @@ -129,13 +130,8 @@ static inline void default_clear_pmem(void __pmem *addr, size_t size) static inline void __pmem *memremap_pmem(struct device *dev, resource_size_t offset, unsigned long size) { -#ifdef ARCH_MEMREMAP_PMEM return (void __pmem *) devm_memremap(dev, offset, size, ARCH_MEMREMAP_PMEM); -#else - return (void __pmem *) devm_memremap(dev, offset, size, - MEMREMAP_WT); -#endif } /**