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: 46799 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp658549wrn; Sat, 21 Jan 2023 02:16:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXvpi+f4Ow6Ez5C3WP+G4zWZnPU/YIU+ltjP1LOZRpRgfC90HbHHmHFG46D8PVCpYYK0uCsC X-Received: by 2002:a17:907:c243:b0:872:84dd:8903 with SMTP id tj3-20020a170907c24300b0087284dd8903mr17051967ejc.59.1674296219628; Sat, 21 Jan 2023 02:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674296219; cv=none; d=google.com; s=arc-20160816; b=mvKM+VOn1Xs4om1kJ2sk4AdpzRsWfUXAapGEw9OECeaz+NM905YJXK16zZ2AfeSV5e tScauFNa9jhpSwUxLOWlxj6IDzWMTNxYUBzy2vNDAkGkkJZOb0cjVK3OjK5IdXThZH9+ BG+EZFv26MF2MqXC8JVD1TXPg9S0fi10k7888a3H5uiQNMs2JKuJrx/9qZPMBtkIoJNz fj6WWQYHpQ0/ncoZ/ecrxCSrJqlA0jDajamHAF4+pLzbr0pZsGWM5iJRKIjf4hKgsLF5 Y6rPR2CRtag/CoewUHqJ+EjmHOukkFYln0CRQCYPBXn40th58pcD2CEyr6Q/0lghHgv/ wakg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OXLUC4JTKUiOXJWTqI4g1HiC+dYjkwB1/gO4I9/BPqI=; b=Noj7+axLVAacArZ2dcs+SYcN+ZMEtSztfRRsGjVM0U37FpUGFaRKdmecM9jcXllm53 ob/rT/ngGXAr7oix0qVm66F5T5G8bQZz+W68Z68g3E8nZCNd0G69GKn4R0pWQ6/ICdq8 bpgN9Zm0JrwmgoDBylCZJ4v0caD/doXcQSbUPsJHZroMi7+6Nft4JCI2z1fDsGqtpf16 9/vnuW9nVIgEw7RrMlHZA1hN/G9Qwhc0HzRgJWBvgeSrR8w+M0E6aPB32MM8LQ9BXjiH Z9Hd0gu7uOqKV2vJ4A1qaNe3ZIo5brVfswQIYVg0CtMAimNeKtyLLC2cgNFf16BoFsgr 6Y8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCEiqGdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du15-20020a17090772cf00b00870c907ed43si1725065ejc.602.2023.01.21.02.16.30; Sat, 21 Jan 2023 02:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCEiqGdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbjAUKMK (ORCPT + 99 others); Sat, 21 Jan 2023 05:12:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjAUKMI (ORCPT ); Sat, 21 Jan 2023 05:12:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6DB535AF for ; Sat, 21 Jan 2023 02:12:07 -0800 (PST) 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 6636EB82B63 for ; 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755626832660399229?= X-GMAIL-MSGID: =?utf-8?q?1755626832660399229?= 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)