From patchwork Sat Jan 21 10:11:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13111049 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 92D9FC27C76 for ; Sat, 21 Jan 2023 10:12:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCE2D6B0072; Sat, 21 Jan 2023 05:12:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D57836B0073; Sat, 21 Jan 2023 05:12:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF82F6B0074; Sat, 21 Jan 2023 05:12:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ABDA26B0072 for ; Sat, 21 Jan 2023 05:12:09 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 76634AB173 for ; Sat, 21 Jan 2023 10:12:09 +0000 (UTC) X-FDA: 80378390778.07.1467521 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id B4EC21C0006 for ; Sat, 21 Jan 2023 10:12:07 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pCEiqGdM; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674295927; 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=OXLUC4JTKUiOXJWTqI4g1HiC+dYjkwB1/gO4I9/BPqI=; b=3L0PA3aMlXjFx24fPPjViIoxUtTtJPmG3IzSa6Oj0yVrDIKrlbxCrz8gMl1YfvvPSHWNYh ZBlrOPFe56IL2LNzlaHCR2yd2uDTTmJXtuI5r/mccr1PKgmTCYK5pox+r21r6yTZpf3cTC p2WhN+6kG05tXHKTDVyKLCfMD4Skj0E= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pCEiqGdM; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674295927; a=rsa-sha256; cv=none; b=LY2gNrOAvK654ZiHuLXp4Pck6dfRZmdKUUunOok1M27A8Ap5U6PbYG5VV6RzOdkDHcD6dP kghKJriZLuL1Q3xH9AYxAjRLY/GI9+2SExdt7q5IWf/7K5rwW+bPNEae+IFZmsDjTiSV8i gzbpcjQ7v/MxJjy8k8JaGjgNG0sVFps= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3218DB82A52; Sat, 21 Jan 2023 10:12:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6C1BC433EF; Sat, 21 Jan 2023 10:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674295924; bh=V8MuxpP8Pi4nAo/iKbDQz0IVxXMZzusqzi08ucS3huo=; h=From:To:Cc:Subject:Date:From; b=pCEiqGdMg7Kmyme9ku4G6/FgCLG24oj128JxZx9nt4ZpU3Bm+nJ/+6LSWdBEIiAR8 8oHoV3UtyoTETH6bsS88DBX/x+kqSN7Yc8a6leFJhD4sMkDiDdwPwnNYsE5qW1p4Qv axJjjmL+VDnk4tqX9JyqvEwgO2RZeDToxQJp1JXe6P95/WMp0wQwqHqCv+qxagnvBP CTgjmTOO0Q/u2Rinqbn3u0IGL03At9NFYFETimbwgOBSyiq3W7AxT2DQAs26d2lzxa jleAuSZcJG1zk6ykCKoUcND936na5GSsdHjLvxb5RWUJBn0ACSbInX60d3gK4HfRt9 GdCqZZ6MpeSrQ== From: Mike Rapoport To: Andrew Morton Cc: Miles Chen , kernel test robot , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Mike Rapoport Subject: [PATCH] mm/sparse: fix "unused function 'pgdat_to_phys'" warning Date: Sat, 21 Jan 2023 12:11:51 +0200 Message-Id: <20230121101151.1703292-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B4EC21C0006 X-Stat-Signature: zp1rh46w6ypjasu96oouprfjsrqwb9d3 X-HE-Tag: 1674295927-459252 X-HE-Meta: U2FsdGVkX182zjSsg021ksFMAhzLVZkYbzZHHgeojSzjRqB8A592EFcGA37rGNidVAciTpVMZhYn1CDGWgDuIPRvWwHgIzrpf/+AuXYcSgSk4xTCDLaMPPsaHL5t7uTxL+T9PpOvjiXfNheLTFhjeywQIQ4JRWV0WD1FdwVFVr7DoR/3Bsmi7n/MNvQnJ7bRcsA1gv695z3Qo/isJhKvJugmTNNkRU/g6MKszAHrflx5kyLc5ERA0GgnWGXQE130+F+YBiq+j4id9yIWEpq33MJys66DPA8y39gT+mEr8fQ+9TBYUgdYo6KuSGTEOvC8uJ4VV1Wp+8Z0CIybuvCirOmm/BYyeoMP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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: W=1 build with clangs complains: mm/sparse.c:347:27: warning: unused function 'pgdat_to_phys' [-Wunused-function] static inline phys_addr_t pgdat_to_phys(struct pglist_data *pgdat) ^ 1 warning generated. pgdat_to_phys() is only used by functions defined when CONFIG_MEMORY_HOTREMOVE=y. Move pgdat_to_phys() under #ifdef CONFIG_MEMORY_HOTREMOVE to make clang happy. Reported-by: kernel test robot Link: https://lore.kernel.org/all/202301210155.1E5zABb5-lkp@intel.com Signed-off-by: Mike Rapoport --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index 2779b419ef2a..fb7aeb1899a4 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -318,6 +318,7 @@ size_t mem_section_usage_size(void) return sizeof(struct mem_section_usage) + usemap_size(); } +#ifdef CONFIG_MEMORY_HOTREMOVE static inline phys_addr_t pgdat_to_phys(struct pglist_data *pgdat) { #ifndef CONFIG_NUMA @@ -328,7 +329,6 @@ static inline phys_addr_t pgdat_to_phys(struct pglist_data *pgdat) #endif } -#ifdef CONFIG_MEMORY_HOTREMOVE static struct mem_section_usage * __init sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, unsigned long size)