Commit da09eb93 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 4251c948
...@@ -298,22 +298,21 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) ...@@ -298,22 +298,21 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
* up a string representation of the passed-in address. * up a string representation of the passed-in address.
*/ */
if (args->servername == NULL) { 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'; servername[0] = '\0';
switch (args->address->sa_family) { switch (args->address->sa_family) {
case AF_INET: { case AF_INET:
struct sockaddr_in *sin =
(struct sockaddr_in *)args->address;
snprintf(servername, sizeof(servername), "%pI4", snprintf(servername, sizeof(servername), "%pI4",
&sin->sin_addr.s_addr); &sin->sin_addr.s_addr);
break; break;
} case AF_INET6:
case AF_INET6: {
struct sockaddr_in6 *sin =
(struct sockaddr_in6 *)args->address;
snprintf(servername, sizeof(servername), "%pI6", snprintf(servername, sizeof(servername), "%pI6",
&sin->sin6_addr); &sin6->sin6_addr);
break; break;
}
default: default:
/* caller wants default server name, but /* caller wants default server name, but
* address family isn't recognized. */ * address family isn't recognized. */
......
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