From patchwork Fri Apr 15 22:15:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 12815479 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 532ECC433F5 for ; Fri, 15 Apr 2022 22:15:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D421C6B0072; Fri, 15 Apr 2022 18:15:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF22C6B0073; Fri, 15 Apr 2022 18:15:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB9AA6B0074; Fri, 15 Apr 2022 18:15:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id A9EB46B0072 for ; Fri, 15 Apr 2022 18:15:08 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6F76211DE for ; Fri, 15 Apr 2022 22:15:08 +0000 (UTC) X-FDA: 79360519896.03.2B6F2EF Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf14.hostedemail.com (Postfix) with ESMTP id 01F5510000C for ; Fri, 15 Apr 2022 22:15:07 +0000 (UTC) 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 X-Rspam-User: X-Rspamd-Queue-Id: 01F5510000C X-Stat-Signature: trjhpb9g4z7a7feqpcd39rago5szjz6o Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=fKSuWrCm; spf=none (imf14.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-Rspamd-Server: rspam01 X-HE-Tag: 1650060907-635374 X-Bogosity: Ham, 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: When CONFIG_SYSCTL=n 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 = 20; -/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ -static const unsigned long dirty_bytes_min = 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 cpu) } #ifdef CONFIG_SYSCTL + +/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ +static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE; + static struct ctl_table vm_page_writeback_sysctls[] = { { .procname = "dirty_background_ratio",