From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754367AbdHYAmk (ORCPT ); Thu, 24 Aug 2017 20:42:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754264AbdHYAmi (ORCPT ); Thu, 24 Aug 2017 20:42:38 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E1BD3356E6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jglisse@redhat.com From: jglisse@redhat.com To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Arnd Bergmann , Andrew Morton , Stephen Rothwell , Subhash Gutti , Evgeny Baskakov Subject: [PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality Date: Thu, 24 Aug 2017 20:42:26 -0400 Message-Id: <1503621746-17876-1-git-send-email-jglisse@redhat.com> In-Reply-To: <20170824230850.1810408-1-arnd@arndb.de> References: <20170824230850.1810408-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 25 Aug 2017 00:42:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jérôme Glisse The struct hmm is only use if the HMM mirror functionality is enabled move associated code behind CONFIG_HMM_MIRROR to avoid build error if one enable some of the HMM memory configuration without the mirror feature. Signed-off-by: Jérôme Glisse Cc: Arnd Bergmann Cc: Andrew Morton , Cc: Stephen Rothwell , Cc: Subhash Gutti , Cc: Evgeny Baskakov --- include/linux/hmm.h | 7 +++---- mm/hmm.c | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 5866f31..b4355d7 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -499,7 +499,7 @@ struct hmm_device *hmm_device_new(void *drvdata); void hmm_device_put(struct hmm_device *hmm_device); #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */ - +#if IS_ENABLED(CONFIG_HMM_MIRROR) /* Below are for HMM internal use only! Not to be used by device driver! */ void hmm_mm_destroy(struct mm_struct *mm); @@ -507,12 +507,11 @@ static inline void hmm_mm_init(struct mm_struct *mm) { mm->hmm = NULL; } - -#else /* IS_ENABLED(CONFIG_HMM) */ - +#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */ /* Below are for HMM internal use only! Not to be used by device driver! */ static inline void hmm_mm_destroy(struct mm_struct *mm) {} static inline void hmm_mm_init(struct mm_struct *mm) {} +#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */ #endif /* IS_ENABLED(CONFIG_HMM) */ #endif /* LINUX_HMM_H */ diff --git a/mm/hmm.c b/mm/hmm.c index 3faa4d4..7e4f42b 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -43,7 +43,7 @@ DEFINE_STATIC_KEY_FALSE(device_private_key); EXPORT_SYMBOL(device_private_key); -#ifdef CONFIG_HMM +#if IS_ENABLED(CONFIG_HMM_MIRROR) static const struct mmu_notifier_ops hmm_mmu_notifier_ops; /* @@ -128,9 +128,7 @@ void hmm_mm_destroy(struct mm_struct *mm) { kfree(mm->hmm); } -#endif /* CONFIG_HMM */ -#if IS_ENABLED(CONFIG_HMM_MIRROR) static void hmm_invalidate_range(struct hmm *hmm, enum hmm_update_type action, unsigned long start, -- 2.7.5