From patchwork Sun Oct 6 17:21:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175299 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3311873ill; Sun, 6 Oct 2019 10:47:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIpwDYoKt7hcvnVgVxEPz702wDqAA4Jcb9ydu9zZ43R8ljwUAFOJvcv/hvrOLbaYfXJsNC X-Received: by 2002:a05:6402:651:: with SMTP id u17mr25838763edx.104.1570384078205; Sun, 06 Oct 2019 10:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384078; cv=none; d=google.com; s=arc-20160816; b=xwB1N/o9eIhPl+J6YVOtt2FGaazj5cPeDhJ/Dunaaem51qIisJstnS7YIMfVJxMNZJ oX5gLPGkCY0j3Vw3FahDXxM1th3Y9pICqvT8tgehUi2MWnrujXBVe0C3LET/I2KTXaSi h0uJxnrL7sC25umaOmRW675bNj5rEjAug4T393/355cUiNrAbNHY8DVm+0DeytY1BCnd JDFfgJWPDXcdHX+BCnxkOcmcni6gVYkDUUdemRTAhU6z+qdJj50maRKY1fer6VHqhj9L rbgnFjxKkA69spDIGhAoLg6MlLt3oB5oqmw/v77MqAMqyZELpOAFt8tPpOzGgAXYTF1I 6czA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QC+/p1pczWOP+Nh1FU9qgFkzAhIGIfWC8EaC4FchpQg=; b=QxeX55DC7z8Z72XJQY4fM8+XvkaiHSvyDT7/VBaxmYPIaklsXOYfQ2/SbQ7D8i2yTb IqnmpqCE+EeURWUlmi7vDvXtnk3p0jSYZWVUHVC4wOMod9gH4moaCTLtNxDglZcz19WR QE53mIoJ2iZMoxeN/mXoCol5CFnjJemR68sCmonN/jzTqUCydfSHvP2Yc4f4SL5bv5RD ut79AhoiS8OorD+SqjKFEjBbHk54avwjVCBvzd/b2TnYXjFyhHgd5+AH+I7cDEydooP5 nB5h+7Lo6CZ9ct5HhHzKvGp+YT4tKSPf+GtlzcsY9WMwutbch5VN1DwNr8ioPaNB49WW FtyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eJ1puECR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 x51si7236623eda.272.2019.10.06.10.47.58; Sun, 06 Oct 2019 10:47:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eJ1puECR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727179AbfJFRr4 (ORCPT + 14 others); Sun, 6 Oct 2019 13:47:56 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(+) -- 2.20.1 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 *);