From nobody Sun Apr 19 11:00:40 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0687AC6FD18 for ; Wed, 29 Mar 2023 08:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjC2IDB (ORCPT ); Wed, 29 Mar 2023 04:03:01 -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 ); 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 ; 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 ; 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 To: Andrew Morton , Luis Chamberlain , Minghao Chi , Vlastimil Babka Cc: Arnd Bergmann , Miaohe Lin , Baolin Wang , Mel Gorman , "Matthew Wilcox (Oracle)" , Kefeng Wang , NARIBAYASHI Akira , 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Without CONFIG_SYSCTL, the compiler warns about a few unused functions: mm/compaction.c:3076:12: error: 'proc_dointvec_minmax_warn_RT_change' defin= ed but not used [-Werror=3Dunused-function] mm/compaction.c:2780:12: error: 'sysctl_compaction_handler' defined but not= used [-Werror=3Dunused-function] mm/compaction.c:2750:12: error: 'compaction_proactiveness_sysctl_handler' d= efined but not used [-Werror=3Dunused-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 fil= e") Signed-off-by: Arnd Bergmann --- mm/compaction.c | 4 ---- 1 file changed, 4 deletions(-) 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; } =20 -#ifdef CONFIG_SYSCTL static struct ctl_table vm_compaction[] =3D { { .procname =3D "compact_memory", @@ -3130,7 +3129,6 @@ static struct ctl_table vm_compaction[] =3D { }, { } }; -#endif =20 static int __init kcompactd_init(void) { @@ -3147,9 +3145,7 @@ static int __init kcompactd_init(void) =20 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) --=20 2.39.2