From: J. Bruce Fields Date: Wed, 8 Oct 2008 19:31:14 +0000 (-0400) Subject: NFS: Cleanup nfs_set_port X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=456018d791ff4ef03d610f72486c637056bcd749;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git NFS: Cleanup nfs_set_port Signed-off-by: "J. Bruce Fields" Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 5d2a5d3c4241..d212ee41caf2 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -285,16 +285,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) */ static inline void nfs_set_port(struct sockaddr *sap, unsigned short port) { + struct sockaddr_in *ap = (struct sockaddr_in *)sap; + struct sockaddr_in6 *ap6 = (struct sockaddr_in6 *)sap; + switch (sap->sa_family) { - case AF_INET: { - struct sockaddr_in *ap = (struct sockaddr_in *)sap; - ap->sin_port = htons(port); - break; - } - case AF_INET6: { - struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap; - ap->sin6_port = htons(port); - break; - } + case AF_INET: + ap->sin_port = htons(port); + break; + case AF_INET6: + ap6->sin6_port = htons(port); + break; } }