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=-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,URIBL_BLOCKED,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 4FE7AC433E0 for ; Tue, 16 Mar 2021 17:14:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE93D65125 for ; Tue, 16 Mar 2021 17:14:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE93D65125 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 6190A6B0036; Tue, 16 Mar 2021 13:14:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EDCF6B006C; Tue, 16 Mar 2021 13:14:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B5E46B006E; Tue, 16 Mar 2021 13:14:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 2E5BF6B0036 for ; Tue, 16 Mar 2021 13:14:08 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E6F3A8249980 for ; Tue, 16 Mar 2021 17:14:07 +0000 (UTC) X-FDA: 77926385334.19.23397F7 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP id 56C12A001AAC for ; Tue, 16 Mar 2021 17:13:57 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 90A0E65013; Tue, 16 Mar 2021 17:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615914835; bh=XieCZyeIda15jzEAAI/y4+VLPR3qlObfVN96dVZaJj0=; h=From:To:Cc:Subject:Date:From; b=ZKdeS6p+E09TOd6dWytI/OA5eYJebcWEdHzd4F5OHYIU7oE4fU1/Fbj2qfzcXddLc bh0IW93QtFFAWthEDQf6AOeTNWZtj4lrILisBDhrRkm6TT0CcZZF5iD/aHw/GWiC6/ oYZOnsYl5+NkKKdRmmiRwAO6ABuCd1xoGosIGNvVB2VVBK1okbwCn5C3+y0Ba+vLxD JVTPVfVxE1QQ2xgmVJMKMxbQBR0c9MFHC1YzDEWWeOpl/B5Jh4RSWLKN3gjLEUXjdF bA06lmb+8f/tnfoFPyCR0mReG4GUqh3dIxpSsk1rxXneBSvMQ+TPgiUaxMILegOxjw 3/NCabqMUHNKA== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , David Hildenbrand , Mike Rapoport , Mike Rapoport , Nick Desaulniers , clang-built-linux@googlegroups.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel test robot Subject: [PATCH] memblock: fix section mismatch warning again Date: Tue, 16 Mar 2021 19:13:47 +0200 Message-Id: <20210316171347.14084-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Stat-Signature: hi58suwtniecpaputgbix11uerez3gru X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 56C12A001AAC Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615914837-955084 Content-Transfer-Encoding: quoted-printable 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: Mike Rapoport Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked memblock_bottom_up() and memblock_set_bottom_up() as __init, but they cou= ld be referenced from non-init functions like memblock_find_in_range_node() = on architectures that enable CONFIG_ARCH_KEEP_MEMBLOCK. For such builds kernel test robot reports: All warnings (new ones prefixed by >>, old ones prefixed by <<): >> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in refer= ence from the function memblock_find_in_range_node() to the function .ini= t.text:memblock_bottom_up() The function memblock_find_in_range_node() references the function __init memblock_bottom_up(). This is often because memblock_find_in_range_node lacks a __init annotation or the annotation of memblock_bottom_up is wrong. Replace __init annotations with __init_memblock annotations so that the appropriate section will be selected depending on CONFIG_ARCH_KEEP_MEMBLOCK. Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp@intel.com Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning") Signed-off-by: Mike Rapoport Reported-by: kernel test robot Reviewed-by: Arnd Bergmann --- @Andrew, please let me know if you'd prefer this merged via memblock tree= . include/linux/memblock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index d13e3cd938b4..5984fff3f175 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t bas= e, phys_addr_t size) /* * Set the allocation direction to bottom-up or top-down. */ -static inline __init void memblock_set_bottom_up(bool enable) +static inline __init_memblock void memblock_set_bottom_up(bool enable) { memblock.bottom_up =3D enable; } @@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool= enable) * if this is true, that said, memblock will allocate memory * in bottom-up direction. */ -static inline __init bool memblock_bottom_up(void) +static inline __init_memblock bool memblock_bottom_up(void) { return memblock.bottom_up; } --=20 2.28.0