From nobody Mon May 11 03:44:09 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 9E8B8C433EF for ; Fri, 15 Apr 2022 22:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243053AbiDOWRi (ORCPT ); Fri, 15 Apr 2022 18:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbiDOWRf (ORCPT ); Fri, 15 Apr 2022 18:17:35 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A8E135867 for ; Fri, 15 Apr 2022 15:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=bxVj2O1o7LGuwxK5yOR+4h1tW8wZ1StFjb76X3rSON4=; b=fKSuWrCm6xuF4e2mK/cydfZ2/M AOwYUVsMSrAdmWo5UrNNcCftgKerHCLBwUfDGOvwh5XlyHvmiTxNkbueKWulSs+RQ7bjqTj9YqlmN VshG4TVTffz5jTDMivIQjw/OZBLtfzm9iAHrl7HoBaruRjQsPVgeZvjvi0tc/yB643bN9R264y139 dfD80J0zOmq2kUiy9gprlZsosoM9p9wKwBDqJMfsqy0nMeSskgnf4Yawe0rA8w/P18L4v3ZJeCob8 PORbz6wXQoTnVxMfbxBO7G3rA4hT0Sw/9G6r19ZvMbeaTTU6SBI17odF8gTK+zMYtOEo5jazfrPhG vuHuV7nw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfUDW-00BYVL-LO; Fri, 15 Apr 2022 22:15:02 +0000 Date: Fri, 15 Apr 2022 15:15:02 -0700 From: Luis Chamberlain To: Andrew Morton Cc: zhanglianjie , patches@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Memory Management List , mcgrof@kernel.org Subject: [PATCH sysctl-next] mm: fix unused variable kernel warning when SYSCTL=n Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When CONFIG_SYSCTL=3Dn the variable dirty_bytes_min which is just used as a minimum to a proc handler is not used. So just move this under the ifdef for CONFIG_SYSCTL. Fixes: aa779e510219 ("mm: move page-writeback sysctls to their own file") Reported-by: kernel test robot Signed-off-by: Luis Chamberlain Acked-by: Andrew Morton --- Andrew, I can this via sysctl-next if that's OK with you. mm/page-writeback.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 438762173a59..4f51d0ac5043 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -89,9 +89,6 @@ static int vm_highmem_is_dirtyable; */ static int vm_dirty_ratio =3D 20; =20 -/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ -static const unsigned long dirty_bytes_min =3D 2 * PAGE_SIZE; - /* * vm_dirty_bytes starts at 0 (disabled) so that it is a function of * vm_dirty_ratio * the amount of dirtyable memory @@ -2077,6 +2074,10 @@ static int page_writeback_cpu_online(unsigned int cp= u) } =20 #ifdef CONFIG_SYSCTL + +/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ +static const unsigned long dirty_bytes_min =3D 2 * PAGE_SIZE; + static struct ctl_table vm_page_writeback_sysctls[] =3D { { .procname =3D "dirty_background_ratio", --=20 2.35.1