Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10639721pxu; Wed, 30 Dec 2020 07:43:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxT+9aE0eswaVZQlBqhA66B8wSYXqOE6F5WYgR1dTBDc2pxCA9VAeL29yBHGD71DVodg5i X-Received: by 2002:a50:d60f:: with SMTP id x15mr50064124edi.224.1609342982516; Wed, 30 Dec 2020 07:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609342982; cv=none; d=google.com; s=arc-20160816; b=nl/YGch4LnJBBRiQ+Y+gHg+bMQZg3S4EQcrmVl5gcWSwHXcac30fu9t3A79rLcFWvP qo+t1gmwjzAeIwyagHfZHylM0rVvwFlGjjsOewyd2zZBba54PDf61vLufqOL+NL9MPGi di9cDE+113md2m1Vn7NCdKTw182CTegQIeEK3gCefe2O+zqPgEzBk0nknkXceJLrN5u9 2GoHiqpzsrASzc2Ib4di3pUaCu4ngDtrUPnmOpW2xWTxzooGgPmDFW30A0UH+kmazFrk m0AIkJa1ab9yj+O5gAnqZfBEcSEITAjbW/HQs4WkMut9XgHU69FiDRQMEbrEI2NFQFBH kXMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JpcVL0fpCE4khFe6mpX/i1uWgrNIXny9ClcdM+IeMzM=; b=AZYyUw8dJI1e05W6QmY7MeRxdbtDHiOehq34zhlnKMekxXYzHH8qQARDbgbtjztVCb /HoqJ9Iyj7lBGF9rINZAeF9FYIKGmIv8aXiTea0H/aaFRAQqWNm1bwMtkeAtu6wMYlmH niKVwTy3Jg/ONoST7oUt7WkDIQ76MDJV1kN3SeDfb5EDudnisqy2LAvhUMhhDYtSd4mz tHxTFjng6W5I/YBs7zuw7bc0g5YrLpMNjIJri5U99xiZGvJNGhru2q/AHGftzU1tA3Hp D0SQIN86TIK6AyKCA0DjQ7Kv0AvC9XO8SvITe38SBLFCywXc7cwsoTUwaU/LyDV60i/L Accg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DAO3IEqE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si21941872ejx.230.2020.12.30.07.42.39; Wed, 30 Dec 2020 07:43:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DAO3IEqE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgL3Plt (ORCPT + 99 others); Wed, 30 Dec 2020 10:41:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:45028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbgL3Plt (ORCPT ); Wed, 30 Dec 2020 10:41:49 -0500 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.29.2