From patchwork Fri Dec 17 02:07:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jackie Liu X-Patchwork-Id: 12683547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B42EC433EF for ; Fri, 17 Dec 2021 02:08:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EA626B0071; Thu, 16 Dec 2021 21:08:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 799F96B0072; Thu, 16 Dec 2021 21:08:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 688806B0073; Thu, 16 Dec 2021 21:08:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 5A8526B0071 for ; Thu, 16 Dec 2021 21:08:35 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0C16B88491 for ; Fri, 17 Dec 2021 02:08:25 +0000 (UTC) X-FDA: 78925651770.08.96C45B8 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf23.hostedemail.com (Postfix) with ESMTP id D886C14000E for ; Fri, 17 Dec 2021 02:08:19 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1639706902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4u9UBuSIYcmV+w+rKJjaDWxKhGJZPhjbVa0YUP8vZ1I=; b=ByrOm2ACAhinhTpRbBz8/qjiKMMVPQE/3WADPh21TUdhuY7hleeljhE7K8X5HPMRhi0ZMh 0VCgElifOM4QTlA7qeTKoIj+84yD76y4bTe6GgzlpYq0zIRGl2jyke2ES4H4+cfuSfMV99 chHyjVFpjdavdB5ZRf0rJRUDuifXucc= From: Jackie Liu To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, liu.yun@linux.dev Subject: [PATCH v2] memblock: fix memblock_phys_alloc() section mismatch error Date: Fri, 17 Dec 2021 10:07:54 +0800 Message-Id: <20211217020754.2874872-1-liu.yun@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D886C14000E X-Stat-Signature: oh7dre3zew8opwckn9y9aqoiym3qin5r Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ByrOm2AC; spf=pass (imf23.hostedemail.com: domain of liu.yun@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=liu.yun@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-HE-Tag: 1639706899-962739 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: Jackie Liu Fix modpost Section mismatch error in memblock_phys_alloc() [...] WARNING: modpost: vmlinux.o(.text.unlikely+0x1dcc): Section mismatch in reference from the function memblock_phys_alloc() to the function .init.text:memblock_phys_alloc_range() The function memblock_phys_alloc() references the function __init memblock_phys_alloc_range(). This is often because memblock_phys_alloc lacks a __init annotation or the annotation of memblock_phys_alloc_range is wrong. ERROR: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. [...] I have checked that the memblock_phys_alloc used in the source tree is all in the __init section, we should make it as always inline. Reported-by: k2ci Suggested-by: Mike Rapoport Signed-off-by: Jackie Liu --- 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 8adcf1fa8096..9dc7cb239d21 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -405,8 +405,8 @@ phys_addr_t memblock_alloc_range_nid(phys_addr_t size, phys_addr_t end, int nid, bool exact_nid); phys_addr_t memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid); -static inline phys_addr_t memblock_phys_alloc(phys_addr_t size, - phys_addr_t align) +static __always_inline phys_addr_t memblock_phys_alloc(phys_addr_t size, + phys_addr_t align) { return memblock_phys_alloc_range(size, align, 0, MEMBLOCK_ALLOC_ACCESSIBLE);