Commit 0dba7c2a authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

NLM: Clean up flow of control in make_socks() function

Clean up: Use Bruce's preferred control flow style in make_socks().
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent d3fe5ea7
...@@ -230,17 +230,23 @@ static int create_lockd_listener(struct svc_serv *serv, char *name, ...@@ -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 make_socks(struct svc_serv *serv)
{ {
static int warned; static int warned;
int err = 0; int err;
err = create_lockd_listener(serv, "udp", nlm_udpport); err = create_lockd_listener(serv, "udp", nlm_udpport);
if (err >= 0) if (err < 0)
err = create_lockd_listener(serv, "tcp", nlm_tcpport); goto out_err;
if (err >= 0) {
warned = 0; err = create_lockd_listener(serv, "tcp", nlm_tcpport);
err = 0; if (err < 0)
} else if (warned++ == 0) goto out_err;
warned = 0;
return 0;
out_err:
if (warned++ == 0)
printk(KERN_WARNING printk(KERN_WARNING
"lockd_up: makesock failed, error=%d\n", err); "lockd_up: makesock failed, error=%d\n", err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment