[PATCH] sunrpc: Don't return NULL from rpcb_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Its callers check for ERR_PTR.

However grep shows that nobody calls this with sa_familiy other than
AF_INET/AF_INET6 so this case can be simply dropped.

Furthermore - the remaining code can be replaced with the existing helper.

Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxx>
---
 net/sunrpc/rpcb_clnt.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index 83af38d..620dee7 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -241,17 +241,7 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
 					RPC_CLNT_CREATE_NONPRIVPORT),
 	};
 
-	switch (srvaddr->sa_family) {
-	case AF_INET:
-		((struct sockaddr_in *)srvaddr)->sin_port = htons(RPCBIND_PORT);
-		break;
-	case AF_INET6:
-		((struct sockaddr_in6 *)srvaddr)->sin6_port = htons(RPCBIND_PORT);
-		break;
-	default:
-		return NULL;
-	}
-
+	rpc_set_port(srvaddr, RPCBIND_PORT);
 	return rpc_create(&args);
 }
 
-- 
1.5.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux