diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2011-05-09 15:22:25 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-05-27 17:42:47 -0400 |
commit | da09eb93033e7204cb3e3f3140b46cf108c42c8f (patch) | |
tree | 549b82e88f751b5398afb5b4582f7a60b7136caf /net | |
parent | 4251c94833aa516c1fc7a0f8f504a26eadd4b91e (diff) | |
download | linux-3.10-da09eb93033e7204cb3e3f3140b46cf108c42c8f.tar.gz linux-3.10-da09eb93033e7204cb3e3f3140b46cf108c42c8f.tar.bz2 linux-3.10-da09eb93033e7204cb3e3f3140b46cf108c42c8f.zip |
SUNRPC: Clean up use of curly braces in switch cases
Clean up. Preferred style is not to use curly braces around
switch cases. I'm about to add another case that needs a third
type cast.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8d83f9d4871..b91f8f943c5 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -298,22 +298,21 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) * up a string representation of the passed-in address. */ if (args->servername == NULL) { + struct sockaddr_in *sin = + (struct sockaddr_in *)args->address; + struct sockaddr_in6 *sin6 = + (struct sockaddr_in6 *)args->address; + servername[0] = '\0'; switch (args->address->sa_family) { - case AF_INET: { - struct sockaddr_in *sin = - (struct sockaddr_in *)args->address; + case AF_INET: snprintf(servername, sizeof(servername), "%pI4", &sin->sin_addr.s_addr); break; - } - case AF_INET6: { - struct sockaddr_in6 *sin = - (struct sockaddr_in6 *)args->address; + case AF_INET6: snprintf(servername, sizeof(servername), "%pI6", - &sin->sin6_addr); + &sin6->sin6_addr); break; - } default: /* caller wants default server name, but * address family isn't recognized. */ |