lockd: define nlm_port_min,max with CONFIG_SYSCTL
authorTom Rix <trix@redhat.com>
Tue, 2 May 2023 18:07:13 +0000 (14:07 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 2 May 2023 19:47:33 +0000 (15:47 -0400)
gcc with W=1 and ! CONFIG_SYSCTL
fs/lockd/svc.c:80:51: error: ‘nlm_port_max’ defined but not used [-Werror=unused-const-variable=]
   80 | static const int                nlm_port_min = 0, nlm_port_max = 65535;
      |                                                   ^~~~~~~~~~~~
fs/lockd/svc.c:80:33: error: ‘nlm_port_min’ defined but not used [-Werror=unused-const-variable=]
   80 | static const int                nlm_port_min = 0, nlm_port_max = 65535;
      |                                 ^~~~~~~~~~~~

The only use of these variables is when CONFIG_SYSCTL
is defined, so their definition should be likewise conditional.

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc.c

index 9a47303b2cba6eae17098d8ce472b58ddb6b0f3b..fe2f6dd9a8743b26022cacbaf47e354219efbcc9 100644 (file)
@@ -77,9 +77,9 @@ static const unsigned long    nlm_grace_period_min = 0;
 static const unsigned long     nlm_grace_period_max = 240;
 static const unsigned long     nlm_timeout_min = 3;
 static const unsigned long     nlm_timeout_max = 20;
-static const int               nlm_port_min = 0, nlm_port_max = 65535;
 
 #ifdef CONFIG_SYSCTL
+static const int               nlm_port_min = 0, nlm_port_max = 65535;
 static struct ctl_table_header * nlm_sysctl_table;
 #endif