diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-12-31 16:06:11 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-01-07 15:40:44 -0500 |
commit | 0dba7c2a9ed3d4a1e58f5d94fffa9f44dbe012e6 (patch) | |
tree | 758e6f346d7aa5d4b987f3fa337de1864b61682f /fs/lockd | |
parent | d3fe5ea7cf815c037c90b1f1464ffc1ab5e8601b (diff) |
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: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/svc.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index cf3899aec375..64f1c31b5853 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -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; } |