提交 fc0b5791 编写于 作者: J Joe Perches 提交者: David S. Miller

net/sunrpc: Remove uses of NIPQUAD, use %pI4

Originally submitted Jan 1, 2010
http://patchwork.kernel.org/patch/71221/

Convert NIPQUAD to the %pI4 format extension where possible
Convert %02x%02x%02x%02x/NIPQUAD to %08x/ntohl
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e9dcd161
......@@ -165,8 +165,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma";
(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
NIPQUAD(sin->sin_addr.s_addr));
(void)snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr));
xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL);
(void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap));
......
......@@ -297,12 +297,11 @@ static void xs_format_common_peer_addresses(struct rpc_xprt *xprt)
switch (sap->sa_family) {
case AF_INET:
sin = xs_addr_in(xprt);
(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
NIPQUAD(sin->sin_addr.s_addr));
snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr));
break;
case AF_INET6:
sin6 = xs_addr_in6(xprt);
(void)snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr);
snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr);
break;
default:
BUG();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册