From patchwork Thu Dec 16 01:17:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jackie Liu X-Patchwork-Id: 12679795 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 54785C433EF for ; Thu, 16 Dec 2021 01:18:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 722526B0071; Wed, 15 Dec 2021 20:18:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D16F6B0073; Wed, 15 Dec 2021 20:18:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C0396B0074; Wed, 15 Dec 2021 20:18:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay025.a.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 4D3DE6B0071 for ; Wed, 15 Dec 2021 20:18:30 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0F87921D0A for ; Thu, 16 Dec 2021 01:18:20 +0000 (UTC) X-FDA: 78921896760.03.EE1A1FF Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf20.hostedemail.com (Postfix) with ESMTP id 05D081C0012 for ; Thu, 16 Dec 2021 01:18:16 +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=1639617497; 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=BRB7wGEqByYcNBuiymfInEGQPpeMLKmekVjDOZIIQu4=; b=l4zxMld1HlqFzh2gIdnHhTiHjDnF+6fjEBY3K9nGMu1eM+uI+vyBecCStxsoAZoBz3kj/J Bu4w4FgWJBa+FZmHp67ctxdoV0dzzqzfJRmQo8E6GywSw0gjtwTlVsQiCTTrxa2W0vooNP G23qP1vDfa206VaV9B4uiz4HlkUCycI= From: Jackie Liu To: rppt@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, liu.yun@linux.dev Subject: [PATCH] memblock: fix memblock_phys_alloc() section mismatch error Date: Thu, 16 Dec 2021 09:17:48 +0800 Message-Id: <20211216011748.1079724-1-liu.yun@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=l4zxMld1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf20.hostedemail.com: domain of liu.yun@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=liu.yun@linux.dev X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 05D081C0012 X-Stat-Signature: jrhzyx9kg5a8biz6mrzuhcujb4766j8o X-HE-Tag: 1639617496-523853 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 also let him save it in this section. Reported-by: k2ci Signed-off-by: Jackie Liu --- include/linux/memblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 8adcf1fa8096..8959d43bc76b 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -405,7 +405,7 @@ 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, +static inline phys_addr_t __init memblock_phys_alloc(phys_addr_t size, phys_addr_t align) { return memblock_phys_alloc_range(size, align, 0,