From patchwork Wed Feb 22 07:04:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 13148769 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 059E1C61DA4 for ; Wed, 22 Feb 2023 07:04:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EBC96B0074; Wed, 22 Feb 2023 02:04:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 69C166B0075; Wed, 22 Feb 2023 02:04:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 563636B0078; Wed, 22 Feb 2023 02:04:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 44CE86B0074 for ; Wed, 22 Feb 2023 02:04:23 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1F0F0C0B6C for ; Wed, 22 Feb 2023 07:04:23 +0000 (UTC) X-FDA: 80494039206.10.EEA4568 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf03.hostedemail.com (Postfix) with ESMTP id DD73B2001E for ; Wed, 22 Feb 2023 07:04:19 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1jOsEuWg; dmarc=none; spf=none (imf03.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677049461; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=MNjuw99R4HgS/gXxR2rjHmB3r482Mpv9GRPW/CNskZA=; b=tNdbCprZe56RUX5r61wTokPkrcV05HunNXcGC9GdI2f5/vQgowzx9cjIVA7zuyFt2Wx8eQ MZFjYto1YrdqzuwuY8uT/SqLXiqv6h5vm1JUvp/H6g+espDOcLerY8/AvQKC3Puw4i8aQ1 RTSKJBQobTgoJfR6fgABRs+cbofn0vs= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1jOsEuWg; dmarc=none; spf=none (imf03.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677049461; a=rsa-sha256; cv=none; b=4uWaeSezugtz6W5Q147QDV5RwsJWE91x3/VR/CLzGeeLChjklJ2jy1p3C+4iRJIcqfvAUG eL6VhbUvGVmXnY/SEt1xrPvhweveGWzGcRBuJHDe3BynXoDAY2HkgB0httl5e9UvC+Jlq5 HnxQNyN4wL6Mng3Q76wE/YtNKEKsrV4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=MNjuw99R4HgS/gXxR2rjHmB3r482Mpv9GRPW/CNskZA=; b=1jOsEuWgQSmtMaFWKT/scfSbVT lUFFM6ktVoaRkQFLyF2Dqnlavx3hi4StHJOm3DIiyzYMOpwbJ/WiD7wqWbLdQo8P/dysFa+u8qZ7/ 1MvcLDhfikHckihLkREpGhA4gg5GQtI2db0kGet+cg5T+sz0sQ/ewjGxM9k9gaU3BwTUUiMH+KfqD /s9h3kxBXjw459cZ0TTwSJpkRXO+OtKN2smJA1oX4s20l56bHONL4yKZUcHSqtuMVy0tWPTUh6Hu0 Nv4I0pQkkr9AiEsRjrUIOEJtPb0FW/mnpre2CKXICO+75bn2r2Nmd+jrHN9UoGutp3RNYMgq/aOZW t6b7kSeg==; Received: from [2601:1c2:980:9ec0::df2f] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUjAi-00B17L-2z; Wed, 22 Feb 2023 07:04:12 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Alexey Kardashevskiy , Christoph Hellwig , iommu@lists.linux.dev, Mike Rapoport , linux-mm@kvack.org Subject: [PATCH] swiotlb: mark swiotlb_memblock_alloc() as __init Date: Tue, 21 Feb 2023 23:04:11 -0800 Message-Id: <20230222070411.6186-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DD73B2001E X-Stat-Signature: hes6hxuuqo8pizzdsadax8m3cqq4mzh6 X-HE-Tag: 1677049459-81354 X-HE-Meta: U2FsdGVkX19HcJ4EZWnyx3XIOG0k100KWlmndp9lTaIKawlq5IrVwa3qfOYC8V92QHzIdTUtxVUqavWRHzeUywYtRsZnbQv301hA3V9K5Joopn5RfIRkGkbveCXA3eLpIgXccii6LS2PTGFRCGKWxDvq8AC7sTgD5W/MhLsjcdr6Hk6ugvc1haY73SRRQix5qsx7mAZKjTtxi2mNYVqYbnr4njAyWiEDkHQ+pwufLniuEUvqg7/TtMC4J/lxyI+rYZKAtmrzx3TCAPJQ8TNrozkUJq/5uFlV8VYc69h6TJzUbFYfZo0Fo+MEXOuUuzO75nxF9iRtYYu9F0DF0p5YvHJqjp1oL8dUWQvsWi+SMLun5JkPuZ50zMvrOKP8vV2AzMIqCGYkXm4vXqPzHKQfYyRt/o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1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: swiotlb_memblock_alloc() calls memblock_alloc(), which calls (__init) memblock_alloc_try_nid(). However, swiotlb_membloc_alloc() can be marked as __init since it is only called by swiotlb_init_remap(), which is already marked as __init. This prevents a modpost build warning/error: WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text) This fixes the build warning/error seen on ARM64, PPC64, S390, i386, and x86_64. Fixes: 8d58aa484920 ("swiotlb: reduce the swiotlb buffer size on allocation failure") Signed-off-by: Randy Dunlap Cc: Alexey Kardashevskiy Cc: Christoph Hellwig Cc: iommu@lists.linux.dev Cc: Mike Rapoport Cc: linux-mm@kvack.org --- kernel/dma/swiotlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -- a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -292,8 +292,9 @@ static void swiotlb_init_io_tlb_mem(stru return; } -static void *swiotlb_memblock_alloc(unsigned long nslabs, unsigned int flags, - int (*remap)(void *tlb, unsigned long nslabs)) +static void __init *swiotlb_memblock_alloc(unsigned long nslabs, + unsigned int flags, + int (*remap)(void *tlb, unsigned long nslabs)) { size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT); void *tlb;