[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130725125405.GC5777@fieldses.org>
Date: Thu, 25 Jul 2013 08:54:05 -0400
From: "J. Bruce Fields" <bfields@...ldses.org>
To: Cong Wang <amwang@...hat.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Trond Myklebust <Trond.Myklebust@...app.com>,
linux-nfs@...r.kernel.org
Subject: Re: [Patch net-next 4/7] sunrpc: use generic union inet_addr
On Thu, Jul 25, 2013 at 08:34:43PM +0800, Cong Wang wrote:
> On Tue, 2013-07-23 at 12:40 -0400, J. Bruce Fields wrote:
> > On Mon, Jul 22, 2013 at 03:05:10PM +0800, Cong Wang wrote:
> > > static inline unsigned short rpc_get_port(const struct sockaddr *sap)
> > > {
> > > - switch (sap->sa_family) {
> > > - case AF_INET:
> > > - return ntohs(((struct sockaddr_in *)sap)->sin_port);
> > > - case AF_INET6:
> > > - return ntohs(((struct sockaddr_in6 *)sap)->sin6_port);
> > > - }
> > > - return 0;
> > > + return inet_addr_get_port((const union inet_addr *)sap);
> > > }
> >
> > Is there any reason to keep the rpc_get_port wrapper at all after this?
> > Or if its still useful to have the convenience of not having to do the
> > cast, maybe the wrapper should move to common code to? (Is there some
> > reason only the rpc code needs this?)
> >
>
> Yeah, the only reason why I keep it is that I don't want to touch all
> the callers of rpc_get_port().
Makes sense, thanks.
--b.
> I agree that we can make it a generic
> function.
>
> Thanks.
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists