Skip to contentSkip to conversation

nfsdctl: Warning Clean Up

PATCH In review Steve Dickson 1 participant 2 messages May 7, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsdctl: Warning Clean Up

Removed a number of unused variables

Initialized a variable that could be used
before initialized

---
 utils/nfsdctl/nfsdctl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
utils/nfsdctl/nfsdctl.c +2 -5
index c2e34260..e7a0e124 100644
@@ -1521,7 +1521,7 @@ static int configure_versions(void)
 
 static int configure_listeners(void)
 {
-	char *port, *rdma_port;
+	char *port, *rdma_port = NULL;
 	bool rdma, udp, tcp;
 	struct conf_list *hosts;
 	int ret = 0;
@@ -1675,10 +1675,7 @@ static void nlm_usage(void)
 
 static int nlm_func(struct nl_sock *sock, int argc, char ** argv)
 {
-	int *threads, grace, lease, idx, ret, opt, pools;
-	struct conf_list *thread_str;
-	struct conf_list_node *n;
-	char *scope, *pool_mode;
+	int opt;
 
 	optind = 1;
 	while ((opt = getopt_long(argc, argv, "h", help_only_options, NULL)) != -1) {
Signature · 1 line
2.49.0
#1 lore raw
Quoted 6 lines · Steve Dickson

Removed a number of unused variables

Initialized a variable that could be used
before initialized

Committed... (tag: nfs-utils-2-8-4-rc1)

steved.

Quoted 29 lines
---
  utils/nfsdctl/nfsdctl.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
utils/nfsdctl/nfsdctl.c +2 -5
index c2e34260..e7a0e124 100644
@@ -1521,7 +1521,7 @@ static int configure_versions(void)
 
  static int configure_listeners(void)
  {
-	char *port, *rdma_port;
+	char *port, *rdma_port = NULL;
  	bool rdma, udp, tcp;
  	struct conf_list *hosts;
  	int ret = 0;
@@ -1675,10 +1675,7 @@ static void nlm_usage(void)
 
  static int nlm_func(struct nl_sock *sock, int argc, char ** argv)
  {
-	int *threads, grace, lease, idx, ret, opt, pools;
-	struct conf_list *thread_str;
-	struct conf_list_node *n;
-	char *scope, *pool_mode;
+	int opt;
 
  	optind = 1;
  	while ((opt = getopt_long(argc, argv, "h", help_only_options, NULL)) != -1) {