From patchwork Wed Dec 30 15:40:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11993303 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 9F37EC433DB for ; Wed, 30 Dec 2020 15:41:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D3E22226A for ; Wed, 30 Dec 2020 15:41:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D3E22226A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 455388D0088; Wed, 30 Dec 2020 10:41:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DEFF8D007F; Wed, 30 Dec 2020 10:41:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A6FF8D0088; Wed, 30 Dec 2020 10:41:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0BCC48D007F for ; Wed, 30 Dec 2020 10:41:11 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C22DF824934B for ; Wed, 30 Dec 2020 15:41:10 +0000 (UTC) X-FDA: 77650362300.21.kiss26_1305553274a6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 94123180442C2 for ; Wed, 30 Dec 2020 15:41:10 +0000 (UTC) X-HE-Tag: kiss26_1305553274a6 X-Filterd-Recvd-Size: 2810 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Dec 2020 15:41:10 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E702F22227; Wed, 30 Dec 2020 15:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609342869; bh=HfZJWC4DgWzxO94oQompi4plJLMZTWGfjqgfqgqfi5U=; h=From:To:Cc:Subject:Date:From; b=DAO3IEqESCs//Kgrgsgvvma3G1GUlcdqVotmH2gNP9/fmWgdVjTYIvo9wOrKG2Vv7 r9zr8/4eGzSaAct25yKZ+fvScsiV5OftBVn6GG7ZjcPu1+jWj8yLdkCnctRwbRTis1 mehMwK6IU2o5KQL/Q0Q80RIce7hefzbhlYirdFA9yziisGTP6nV0LtPnP7uniqNbLL ytonIXr2P+j5DnoW5xJE2Nuf24cshMLKoUnlmLTbyeppkIq2Q3If9oNKBk9B7qTCB2 EMUAgPxOpmXQsjeiQ9oquQxfdJXNtzeCa5D5KNXzudr84xtm5Cfy8ISQ6C2dnWRQxK RSnO08W3oF9lA== From: Arnd Bergmann To: Andrew Morton , Nathan Chancellor , Nick Desaulniers , "Kirill A. Shutemov" , Wei Yang Cc: Arnd Bergmann , Vlastimil Babka , Dmitry Safonov <0x7f454c46@gmail.com>, Brian Geffon , linux-mm@kvack.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent Date: Wed, 30 Dec 2020 16:40:40 +0100 Message-Id: <20201230154104.522605-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann clang cannt evaluate this function argument at compile time when the function is not inlined, which leads to a link time failure: ld.lld: error: undefined symbol: __compiletime_assert_414 >>> referenced by mremap.c >>> mremap.o:(get_extent) in archive mm/built-in.a Mark the function as __always_inline to avoid it. Fixes: 9ad9718bfa41 ("mm/mremap: calculate extent in one place") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Tested-by: Sedat Dilek Tested-by: Nick Desaulniers --- mm/mremap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/mremap.c b/mm/mremap.c index c5590afe7165..1cb464a07184 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -336,8 +336,9 @@ enum pgt_entry { * valid. Else returns a smaller extent bounded by the end of the source and * destination pgt_entry. */ -static unsigned long get_extent(enum pgt_entry entry, unsigned long old_addr, - unsigned long old_end, unsigned long new_addr) +static __always_inline unsigned long get_extent(enum pgt_entry entry, + unsigned long old_addr, unsigned long old_end, + unsigned long new_addr) { unsigned long next, extent, mask, size;