From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A861C4360C for ; Sun, 6 Oct 2019 17:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 255722053B for ; Sun, 6 Oct 2019 17:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570384084; bh=Wk4nPLxqKbyr+4wrsBpGefst6njL/ETV2Bw+Kk2IN90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MOj+lijx+Wb8CljEnKuU/lW5qYe9ZaLSUWtHoQuwVBhay6yyg0kqPoflXckRpELUx iZbczIz+lPEmSNIBOixL+vHQ1Xt6GekpBxB99jkuQI15IlbcGQJY4P2XtwHQm0ZjQp m5lqReLnhq4QHzJn4AHLoEFQcYHPZ/mBjTNL1NG0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730973AbfJFRr7 (ORCPT ); Sun, 6 Oct 2019 13:47:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:44470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731081AbfJFRoR (ORCPT ); Sun, 6 Oct 2019 13:44:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA4D920700; Sun, 6 Oct 2019 17:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383857; bh=Wk4nPLxqKbyr+4wrsBpGefst6njL/ETV2Bw+Kk2IN90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJ1puECRoIcd+FrFA8SGucMZ6EUKY61KCtCSawUNl5iewPSX/kWrA7f5lLRhnTEt6 g4MeZZ6fApymsN42IiWBFV4R+/CqKt1ty2husDThs5BqOJMH1FmDZIpkVAwoEMgvL5 uqWJTT8KpNcArUMnjPSgT1VkLxvMTycTXgyxUXYM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jason Gunthorpe , Michal Hocko , Bernard Metzler , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.3 120/166] mm: add dummy can_do_mlock() helper Date: Sun, 6 Oct 2019 19:21:26 +0200 Message-Id: <20191006171223.408924054@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 710ec38b0f633ab3e2581f07a73442d809e28ab0 ] On kernels without CONFIG_MMU, we get a link error for the siw driver: drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get': siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock' This is probably not the only driver that needs the function and could otherwise build correctly without CONFIG_MMU, so add a dummy variant that always returns false. Link: http://lkml.kernel.org/r/20190909204201.931830-1-arnd@arndb.de Fixes: 2251334dcac9 ("rdma/siw: application buffer management") Signed-off-by: Arnd Bergmann Suggested-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Bernard Metzler Cc: "Matthew Wilcox (Oracle)" Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0334ca97c584d..fe4552e1c40b4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1405,7 +1405,11 @@ extern void pagefault_out_of_memory(void); extern void show_free_areas(unsigned int flags, nodemask_t *nodemask); +#ifdef CONFIG_MMU extern bool can_do_mlock(void); +#else +static inline bool can_do_mlock(void) { return false; } +#endif extern int user_shm_lock(size_t, struct user_struct *); extern void user_shm_unlock(size_t, struct user_struct *); -- 2.20.1