From patchwork Wed Apr 4 11:02:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132811 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4908608ljb; Wed, 4 Apr 2018 04:02:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx49H/BMPce55Mu35PtL4C56gH6fuezYQ0rpdt9fq4OnR5pq2/VTNYqEWm57RuXWDIEgZtoyU X-Received: by 10.98.58.129 with SMTP id v1mr13486565pfj.231.1522839777685; Wed, 04 Apr 2018 04:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522839777; cv=none; d=google.com; s=arc-20160816; b=gdFxoRRTKpAsP2ZYi9f89BRsg+pwjlAuhY7+iWpy56Tenn5NcCEji9CGmvxj6Jzpir aISC+px3w/OXZC2NVcENIRS3YqBg4WJT4yd1MQ7z9VcE/pzWjC2NyNSyy8ou8jUmwe9U 93xrlW9X6DbXeiXWYneYesJa3sGorNnrGh53bEH+i2L7HO90i1/zQnGGIma3eNe7f805 +fK4RbucXxubhbdLZuhIFiTL9+Tjc38IXChbH+AuNSPo2p9LUVhgmfln+r+XgLiLSYim n3oQa0Fe+i7I4PazErKRD0GP1UQoPVP+hWBC76YNRQoFkZ0y7HJLfNQxwqeoq9zC7qNJ hWtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ll2/a4XmxS7VSd8yYnFWehHFjQ/xQRh8oNd6F5f85VY=; b=Q5PEzOBS8wsyh7zctWybP4M2KqkPTL2GJpr917lcjPDALHw7E4gsZz9MiT29mB4fps PhKNT9Flp5e+g+KyUlZEUTYYi1CUGaDnSHhC5V7XNH7K4KDbg9X5iMZrAxDQs/tEw56s qQVGVcPtXhfGprwMDV3aQUJy69l8/Dk0H2gGb1W3i4YFnz0btFunlBePvlN4cuaQfT81 Jz7HKTo8YUZYncVfjjUjkDsbjipmSzwMiT5O3HPCoJep5O4lHEJcedQeCjTPyI+hdbSY R7N5o8f03GjK9F+bXhAYU+DBtNPF5L1k8mrRvcOOp6lmvWfYMbQ2tMeDStJzFmTRhxJo K2dw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123si3915911pfs.234.2018.04.04.04.02.56; Wed, 04 Apr 2018 04:02:56 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbeDDLCw (ORCPT + 29 others); Wed, 4 Apr 2018 07:02:52 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:46283 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbeDDLCv (ORCPT ); Wed, 4 Apr 2018 07:02:51 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MORLZ-1f7F5Q2op3-005nzJ; Wed, 04 Apr 2018 13:02:41 +0200 From: Arnd Bergmann To: =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= Cc: Arnd Bergmann , Andrew Morton , John Hubbard , Stephen Rothwell , Evgeny Baskakov , Ralph Campbell , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/hmm: fix header file if/else/endif maze, again Date: Wed, 4 Apr 2018 13:02:15 +0200 Message-Id: <20180404110236.804484-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:AjSem3M4QFj2sbyv/g/BJZ7YLu/aXJLUZxdKnTt3lE44DyQYdSb 8JASsnboKQZd9qgVvhVWAJW2+xuozXq6G1hOKy0Wqq+EgNJNus31B42/blWxBmsLlWOJWCk r9jcG8D7N8HVKy0kIPQ4jD6BMsC90Kc61vhHXTZfxBxlPoqOkWl6zIG0YuRbdQePGsYvPPg JDp7JTwUBtTnV4g09Ip7A== X-UI-Out-Filterresults: notjunk:1; V01:K0:coonID6VBzE=:7KKWGZ72uf01L5nG1NzW+v c7DgWu1HZwJ9mRPdGiPmv8VVFhpK6YFYD5/u3hHIfNWSPCcxYSHCRH//6a7chjtQXggPk449d WxzmHjd7NWr0Rcw9b2hZP3/jHRfghJvldX600jloEV6/9CEVn7sBssvS4VlLDRTlcqM2TPMhG he+5H9JM4sXevGn4lfvQvYadDq71KvIo1K5l13UnIxUYcP6Sw7v1/ceAIjDjPQB9INLsGnRx9 /3O2n+Rjr8NCeXSYISe5JUPAsKAFTWec/qQc11HZV3z3ndsP0wtN14UPwFssxBnKdNzq/+K63 4xnvT0lVVt/Ee75w8ds1ozn8c+w1iBNdHZj2moOCYh7wfcu9FfLvtnwHncvSAE8wG5Uhme9uU 2yVXWrMhNZBwubZ0ath3RXLJldqg89iirkMx74/U2nIOOAZLqDRgyshW00xDCk26stvFOYjci kdqOjbe6AUBbgofWNutmBMFckfuOMjPvo2l/Yd9AOipzCC9lsVGvJH0hjQukuh5zyf0DOuT+R uFctC5paKRReXFzb0QDpavpMKVua0G0nRtCtXtkPiF00CFaDy6iIAQC3Osi1crICXp0AkKE8E ufPRQHaraE4TF7cua5Qe6Su5AROc+kCpXt6GgfGQ7gn/XrfBxGFrYSTLR1PICBtaVnOMCXWnm SEaBwWjPFiOlAG1qNCM+34aEEymDb2dol4/wuCW5M24WeVwK7XmNWZVbBHozYw1Cec0frQxgx Qbm87qnFWj86t2mLZQUFoCToRt/riyLTF5ea0g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The last fix was still wrong, as we need the inline dummy functions also for the case that CONFIG_HMM is enabled but CONFIG_HMM_MIRROR is not: kernel/fork.o: In function `__mmdrop': fork.c:(.text+0x14f6): undefined reference to `hmm_mm_destroy' This adds back the second copy of the dummy functions, hopefully this time in the right place. Fixes: 8900d06a277a ("mm/hmm: fix header file if/else/endif maze") Signed-off-by: Arnd Bergmann --- include/linux/hmm.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) -- 2.9.0 Reviewed-by: Jérôme Glisse diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 5d26e0a223d9..39988924de3a 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -376,8 +376,18 @@ bool hmm_vma_range_done(struct hmm_range *range); * See the function description in mm/hmm.c for further documentation. */ int hmm_vma_fault(struct hmm_range *range, bool block); -#endif /* 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); + +static inline void hmm_mm_init(struct mm_struct *mm) +{ + mm->hmm = NULL; +} +#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */ +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) */ #if IS_ENABLED(CONFIG_DEVICE_PRIVATE) || IS_ENABLED(CONFIG_DEVICE_PUBLIC) struct hmm_devmem; @@ -550,16 +560,9 @@ struct hmm_device { struct hmm_device *hmm_device_new(void *drvdata); void hmm_device_put(struct hmm_device *hmm_device); #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */ - -/* Below are for HMM internal use only! Not to be used by device driver! */ -void hmm_mm_destroy(struct mm_struct *mm); - -static inline void hmm_mm_init(struct mm_struct *mm) -{ - mm->hmm = NULL; -} #else /* IS_ENABLED(CONFIG_HMM) */ 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) */ + #endif /* LINUX_HMM_H */