Skip to contentSkip to conversation

lockd: define nlm_port_min,max with CONFIG_SYSCTL

PATCH In review Tom Rix 3 participants 3 messages May 2, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 lockd: define nlm_port_min,max with CONFIG_SYSCTL

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.

---
 fs/lockd/svc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lockd/svc.c +1 -1
index bb94949bc223..04ba95b83d16 100644
@@ -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
 
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Tom Rix

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.

---
 fs/lockd/svc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lockd/svc.c +0 -0
index bb94949bc223..04ba95b83d16 100644

fs/lockd/svc.c static const unsigned long nlm_grace_period_min = 0; · line 85

Quoted 10 lines
fs/lockd/svc.c +1 -1
@@ -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
 
#2 lore raw
Quoted 31 lines · Jeff Layton
Quoted 26 lines · Tom Rix

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.

---
fs/lockd/svc.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/lockd/svc.c +0 -1
index bb94949bc223..04ba95b83d16 100644
@@ -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;
 
Quoted 7 lines

fs/lockd/svc.c static const unsigned long nlm_grace_period_min = 0; · line 85

Quoted 5 lines
fs/lockd/svc.c +1 -0
 #ifdef CONFIG_SYSCTL
+static const int nlm_port_min = 0, nlm_port_max = 65535;
 static struct ctl_table_header * nlm_sysctl_table;
 #endif
 

Provisionally applied to nfsd-fixes. Thanks!

--
Chuck Lever