NLM: Clean up flow of control in make_socks() function
authorChuck Lever <chuck.lever@oracle.com>
Wed, 31 Dec 2008 21:06:11 +0000 (16:06 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 7 Jan 2009 20:40:44 +0000 (15:40 -0500)
Clean up: Use Bruce's preferred control flow style in make_socks().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/lockd/svc.c

index cf3899aec375c39758ae8d571c00517fa582a23b..64f1c31b58533317d65a256b79e1d5c474620421 100644 (file)
@@ -230,17 +230,23 @@ static int create_lockd_listener(struct svc_serv *serv, char *name,
 static int make_socks(struct svc_serv *serv)
 {
        static int warned;
-       int err = 0;
+       int err;
 
        err = create_lockd_listener(serv, "udp", nlm_udpport);
-       if (err >= 0)
-               err = create_lockd_listener(serv, "tcp", nlm_tcpport);
-       if (err >= 0) {
-               warned = 0;
-               err = 0;
-       } else if (warned++ == 0)
+       if (err < 0)
+               goto out_err;
+
+       err = create_lockd_listener(serv, "tcp", nlm_tcpport);
+       if (err < 0)
+               goto out_err;
+
+       warned = 0;
+       return 0;
+
+out_err:
+       if (warned++ == 0)
                printk(KERN_WARNING
-                      "lockd_up: makesock failed, error=%d\n", err);
+                       "lockd_up: makesock failed, error=%d\n", err);
        return err;
 }