Message ID | 20230329080248.2543492-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp246983vqo; Wed, 29 Mar 2023 01:14:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZGpC2diiHKrHMs6OYLJTEUb72hFG8K+iPqBAOkEtAZstS0G51hEinWV/tIpOpqtavuHNZb X-Received: by 2002:a17:906:174b:b0:929:7d80:3a37 with SMTP id d11-20020a170906174b00b009297d803a37mr18577646eje.37.1680077698240; Wed, 29 Mar 2023 01:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680077698; cv=none; d=google.com; s=arc-20160816; b=DPu4pC32liP48EMQ9I0/hXyE+iyTlYc10iTpeEdPO81eelzUbuJKVX4nfK/eqUiQj4 tyCKczg7C5qNTf2zgEWIuTqAAvdq3l+20gfyQC74UE79t0yl9G8v9yF4ksfttHEXND1z AOBYJFSGQAMHiOrH3KsNCq6Tt4EWML+LHSUAiP7X5E8Z3J8oTPLhsU5yoaCN8kDzNkGp hhP1sPc2so1YUYPL+efaIJYu9S+gxvuUKJ4GD5LPn/Ngh8vgNDVbzO9tH9LR2yWdNrQU mpKTbCoAO5ShdUJGeOJhyWNmz1dweoXx9qUFbDPX5y0P3X7eq7orE4L1hoSbh8y7WaP8 8JfA== 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=eTRpX3jW7TH42nWWQvGtpj1dA+UZjyFRIjoULCtIjAA=; b=GpKKb8JWiSSUSzn5K2FBas0pv6K5BV5YPbjdvu4ieutmwXVIxykQcuVr3KXy7wcITh c6525IXGMBrXeMgorCy/AuwjCE8mObC2Gv8qT4ASUwCbL8eBpAgiM4JFW0rF1ABdH8gQ 3rQsP8eN7bD2G/oRggAXUEaZfb95lcjIOlxhQDIgKAr8ZBjZ1hs1yobN8/qeehL2qr6J ciSScIz8Yq2j4Ua0crTMJs8zMzAYYWczh1zM2nkfW4F0JOp3N8zjCpSJGjw933fkjERk uyWThwqZLfRP/+oLkefytAW8Y0F01b7arjbHFi8JeDA5LeB5nMyT3QNAmshzUyGjvAJs 2ucw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hA0X1vVf; 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 x26-20020a1709060a5a00b009314c7ae06csi34102026ejf.191.2023.03.29.01.14.34; Wed, 29 Mar 2023 01:14:58 -0700 (PDT) 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=hA0X1vVf; 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 S229916AbjC2IDA (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Wed, 29 Mar 2023 04:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbjC2IC6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Mar 2023 04:02:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B3431BFB for <linux-kernel@vger.kernel.org>; Wed, 29 Mar 2023 01:02:57 -0700 (PDT) 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 17102B81ADA for <linux-kernel@vger.kernel.org>; Wed, 29 Mar 2023 08:02:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0902FC433D2; Wed, 29 Mar 2023 08:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680076974; bh=92TAbqWARXeujUx3JkwuNmKYR3DjPGLIhIOnKSx3mpg=; h=From:To:Cc:Subject:Date:From; b=hA0X1vVfmB6PTFroH5fIUajvrFvPW7/4V1OzE58pVDoViEAq4MMhFMcCITGr9/ZBx O5wXJBH67X8+23zbSvNdt2XtsQArIH0tL7zQwJfG0eZPOybQOskXcTYp9br6vpO606 U24LeJkIp+DqPp9CMZjCPmX6d+PHZda8ufgoVjejP3ki3NGyi3u4FpFdnX8bDXHlq/ 52X/gLoXIvzvpRNcDTRRlraRp0o+AN1IxlDFBaeDQl3WZNd6SN8qilKnjA7BXmEN1C JxdDttsCSLghrxLhzZJCaPz1+1MSNHRUbieMfcyKcdPiR6W6NVpjsfNTW2FZnO5BVp Z8bV/CUymVw7A== From: Arnd Bergmann <arnd@kernel.org> To: Andrew Morton <akpm@linux-foundation.org>, Luis Chamberlain <mcgrof@kernel.org>, Minghao Chi <chi.minghao@zte.com.cn>, Vlastimil Babka <vbabka@suse.cz> Cc: Arnd Bergmann <arnd@arndb.de>, Miaohe Lin <linmiaohe@huawei.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Mel Gorman <mgorman@techsingularity.net>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Kefeng Wang <wangkefeng.wang@huawei.com>, NARIBAYASHI Akira <a.naribayashi@fujitsu.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: compaction: remove incorrect #ifdef checks Date: Wed, 29 Mar 2023 10:02:41 +0200 Message-Id: <20230329080248.2543492-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761689152578846923?= X-GMAIL-MSGID: =?utf-8?q?1761689152578846923?= |
Series |
mm: compaction: remove incorrect #ifdef checks
|
|
Commit Message
Arnd Bergmann
March 29, 2023, 8:02 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> Without CONFIG_SYSCTL, the compiler warns about a few unused functions: mm/compaction.c:3076:12: error: 'proc_dointvec_minmax_warn_RT_change' defined but not used [-Werror=unused-function] mm/compaction.c:2780:12: error: 'sysctl_compaction_handler' defined but not used [-Werror=unused-function] mm/compaction.c:2750:12: error: 'compaction_proactiveness_sysctl_handler' defined but not used [-Werror=unused-function] The #ifdef is actually not necessary here, as the alternative register_sysctl_init() stub function does not use its argument, which lets the compiler drop the rest implicitly, while avoiding the warning. Fixes: c521126610c3 ("mm: compaction: move compaction sysctl to its own file") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- mm/compaction.c | 4 ---- 1 file changed, 4 deletions(-)
Comments
On Wed, Mar 29, 2023 at 10:02:41AM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Without CONFIG_SYSCTL, the compiler warns about a few unused functions: > > mm/compaction.c:3076:12: error: 'proc_dointvec_minmax_warn_RT_change' defined but not used [-Werror=unused-function] > mm/compaction.c:2780:12: error: 'sysctl_compaction_handler' defined but not used [-Werror=unused-function] > mm/compaction.c:2750:12: error: 'compaction_proactiveness_sysctl_handler' defined but not used [-Werror=unused-function] > > The #ifdef is actually not necessary here, as the alternative > register_sysctl_init() stub function does not use its argument, which > lets the compiler drop the rest implicitly, while avoiding the warning. > > Fixes: c521126610c3 ("mm: compaction: move compaction sysctl to its own file") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Thanks! Queued up. Luis
diff --git a/mm/compaction.c b/mm/compaction.c index 3dfdb84b9c98..c8bcdea15f5f 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -3092,7 +3092,6 @@ static int proc_dointvec_minmax_warn_RT_change(struct ctl_table *table, return ret; } -#ifdef CONFIG_SYSCTL static struct ctl_table vm_compaction[] = { { .procname = "compact_memory", @@ -3130,7 +3129,6 @@ static struct ctl_table vm_compaction[] = { }, { } }; -#endif static int __init kcompactd_init(void) { @@ -3147,9 +3145,7 @@ static int __init kcompactd_init(void) for_each_node_state(nid, N_MEMORY) kcompactd_run(nid); -#ifdef CONFIG_SYSCTL register_sysctl_init("vm", vm_compaction); -#endif return 0; } subsys_initcall(kcompactd_init)