Skip to content

Commit 3c6a4cb

Browse files
committed
mm: fix unused variable kernel warning when SYSCTL=n
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: aa779e5 ("mm: move page-writeback sysctls to their own file") Reported-by: kernel test robot <[email protected]> Acked-by: Andrew Morton <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 988f11e commit 3c6a4cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mm/page-writeback.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ static int vm_highmem_is_dirtyable;
8989
*/
9090
static int vm_dirty_ratio = 20;
9191

92-
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
93-
static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
94-
9592
/*
9693
* vm_dirty_bytes starts at 0 (disabled) so that it is a function of
9794
* vm_dirty_ratio * the amount of dirtyable memory
@@ -2077,6 +2074,10 @@ static int page_writeback_cpu_online(unsigned int cpu)
20772074
}
20782075

20792076
#ifdef CONFIG_SYSCTL
2077+
2078+
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
2079+
static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
2080+
20802081
static struct ctl_table vm_page_writeback_sysctls[] = {
20812082
{
20822083
.procname = "dirty_background_ratio",

0 commit comments

Comments
 (0)