Skip to content

Commit

Permalink
staging/lustre: remove HIPQUAD
Browse files Browse the repository at this point in the history
Stephen Rothwell reported below error on powerpc:

In file included from drivers/staging/lustre/include/linux/libcfs/libcfs.h:203:0,
                 from drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h:67,
                 from drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:41:
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c: In function 'kiblnd_dev_need_failover':
drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h:215:16: error: implicit declaration of function 'NIPQUAD' [-Werror=implicit-function-declaration]
  static struct libcfs_debug_msg_data msgdata;      \
                ^
We should just remove HIPQUAD and replace it with %pI4h.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peng Tao authored and Greg Kroah-Hartman committed Jul 23, 2013
1 parent c1042ed commit 5e8f692
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 160 deletions.
15 changes: 0 additions & 15 deletions drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,6 @@

#include <net/sock.h>

#ifndef HIPQUAD
// XXX Should just kill all users
#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
((unsigned char *)&addr)[3], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[0]
#elif defined(__BIG_ENDIAN)
#define HIPQUAD NIPQUAD
#else
#error "Please fix asm/byteorder.h"
#endif /* __LITTLE_ENDIAN */
#endif

typedef struct socket socket_t;

#define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf)
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,8 +2574,8 @@ kiblnd_dev_need_failover(kib_dev_t *dev)
rc = rdma_resolve_addr(cmid, (struct sockaddr *)&srcaddr,
(struct sockaddr *)&dstaddr, 1);
if (rc != 0 || cmid->device == NULL) {
CERROR("Failed to bind %s:%u.%u.%u.%u to device(%p): %d\n",
dev->ibd_ifname, HIPQUAD(dev->ibd_ifip),
CERROR("Failed to bind %s:%pI4h to device(%p): %d\n",
dev->ibd_ifname, &dev->ibd_ifip,
cmid->device, rc);
rdma_destroy_id(cmid);
return rc;
Expand Down Expand Up @@ -2647,8 +2647,8 @@ kiblnd_dev_failover(kib_dev_t *dev)
/* Bind to failover device or port */
rc = rdma_bind_addr(cmid, (struct sockaddr *)&addr);
if (rc != 0 || cmid->device == NULL) {
CERROR("Failed to bind %s:%u.%u.%u.%u to device(%p): %d\n",
dev->ibd_ifname, HIPQUAD(dev->ibd_ifip),
CERROR("Failed to bind %s:%pI4h to device(%p): %d\n",
dev->ibd_ifname, &dev->ibd_ifip,
cmid->device, rc);
rdma_destroy_id(cmid);
goto out;
Expand Down
12 changes: 6 additions & 6 deletions drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,9 +1319,9 @@ kiblnd_connect_peer (kib_peer_t *peer)
}

LASSERT (cmid->device != NULL);
CDEBUG(D_NET, "%s: connection bound to %s:%u.%u.%u.%u:%s\n",
CDEBUG(D_NET, "%s: connection bound to %s:%pI4h:%s\n",
libcfs_nid2str(peer->ibp_nid), dev->ibd_ifname,
HIPQUAD(dev->ibd_ifip), cmid->device->name);
&dev->ibd_ifip, cmid->device->name);

return;

Expand Down Expand Up @@ -2209,8 +2209,8 @@ kiblnd_passive_connect (struct rdma_cm_id *cmid, void *priv, int priv_nob)
if (*kiblnd_tunables.kib_require_priv_port &&
ntohs(peer_addr->sin_port) >= PROT_SOCK) {
__u32 ip = ntohl(peer_addr->sin_addr.s_addr);
CERROR("Peer's port (%u.%u.%u.%u:%hu) is not privileged\n",
HIPQUAD(ip), ntohs(peer_addr->sin_port));
CERROR("Peer's port (%pI4h:%hu) is not privileged\n",
&ip, ntohs(peer_addr->sin_port));
goto failed;
}

Expand Down Expand Up @@ -2254,11 +2254,11 @@ kiblnd_passive_connect (struct rdma_cm_id *cmid, void *priv, int priv_nob)
if (ni == NULL || /* no matching net */
ni->ni_nid != reqmsg->ibm_dstnid || /* right NET, wrong NID! */
net->ibn_dev != ibdev) { /* wrong device */
CERROR("Can't accept %s on %s (%s:%d:%u.%u.%u.%u): "
CERROR("Can't accept %s on %s (%s:%d:%pI4h): "
"bad dst nid %s\n", libcfs_nid2str(nid),
ni == NULL ? "NA" : libcfs_nid2str(ni->ni_nid),
ibdev->ibd_ifname, ibdev->ibd_nnets,
HIPQUAD(ibdev->ibd_ifip),
&ibdev->ibd_ifip,
libcfs_nid2str(reqmsg->ibm_dstnid));

goto failed;
Expand Down
50 changes: 25 additions & 25 deletions drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,17 @@ ksocknal_associate_route_conn_locked(ksock_route_t *route, ksock_conn_t *conn)
if (route->ksnr_myipaddr != conn->ksnc_myipaddr) {
if (route->ksnr_myipaddr == 0) {
/* route wasn't bound locally yet (the initial route) */
CDEBUG(D_NET, "Binding %s %u.%u.%u.%u to %u.%u.%u.%u\n",
CDEBUG(D_NET, "Binding %s %pI4h to %pI4h\n",
libcfs_id2str(peer->ksnp_id),
HIPQUAD(route->ksnr_ipaddr),
HIPQUAD(conn->ksnc_myipaddr));
&route->ksnr_ipaddr,
&conn->ksnc_myipaddr);
} else {
CDEBUG(D_NET, "Rebinding %s %u.%u.%u.%u from "
"%u.%u.%u.%u to %u.%u.%u.%u\n",
CDEBUG(D_NET, "Rebinding %s %pI4h from "
"%pI4h to %pI4h\n",
libcfs_id2str(peer->ksnp_id),
HIPQUAD(route->ksnr_ipaddr),
HIPQUAD(route->ksnr_myipaddr),
HIPQUAD(conn->ksnc_myipaddr));
&route->ksnr_ipaddr,
&route->ksnr_myipaddr,
&conn->ksnc_myipaddr);

iface = ksocknal_ip2iface(route->ksnr_peer->ksnp_ni,
route->ksnr_myipaddr);
Expand Down Expand Up @@ -384,9 +384,9 @@ ksocknal_add_route_locked (ksock_peer_t *peer, ksock_route_t *route)
route2 = list_entry(tmp, ksock_route_t, ksnr_list);

if (route2->ksnr_ipaddr == route->ksnr_ipaddr) {
CERROR ("Duplicate route %s %u.%u.%u.%u\n",
CERROR("Duplicate route %s %pI4h\n",
libcfs_id2str(peer->ksnp_id),
HIPQUAD(route->ksnr_ipaddr));
&route->ksnr_ipaddr);
LBUG();
}
}
Expand Down Expand Up @@ -982,8 +982,8 @@ ksocknal_accept (lnet_ni_t *ni, socket_t *sock)
LIBCFS_ALLOC(cr, sizeof(*cr));
if (cr == NULL) {
LCONSOLE_ERROR_MSG(0x12f, "Dropping connection request from "
"%u.%u.%u.%u: memory exhausted\n",
HIPQUAD(peer_ip));
"%pI4h: memory exhausted\n",
&peer_ip);
return -ENOMEM;
}

Expand Down Expand Up @@ -1236,10 +1236,10 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route,
* code below probably isn't going to work. */
if (active &&
route->ksnr_ipaddr != conn->ksnc_ipaddr) {
CERROR("Route %s %u.%u.%u.%u connected to %u.%u.%u.%u\n",
CERROR("Route %s %pI4h connected to %pI4h\n",
libcfs_id2str(peer->ksnp_id),
HIPQUAD(route->ksnr_ipaddr),
HIPQUAD(conn->ksnc_ipaddr));
&route->ksnr_ipaddr,
&conn->ksnc_ipaddr);
}

/* Search for a route corresponding to the new connection and
Expand Down Expand Up @@ -1297,10 +1297,10 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route,
* socket callbacks.
*/

CDEBUG(D_NET, "New conn %s p %d.x %u.%u.%u.%u -> %u.%u.%u.%u/%d"
CDEBUG(D_NET, "New conn %s p %d.x %pI4h -> %pI4h/%d"
" incarnation:"LPD64" sched[%d:%d]\n",
libcfs_id2str(peerid), conn->ksnc_proto->pro_version,
HIPQUAD(conn->ksnc_myipaddr), HIPQUAD(conn->ksnc_ipaddr),
&conn->ksnc_myipaddr, &conn->ksnc_ipaddr,
conn->ksnc_port, incarnation, cpt,
(int)(sched - &sched->kss_info->ksi_scheds[0]));

Expand Down Expand Up @@ -1648,10 +1648,10 @@ ksocknal_destroy_conn (ksock_conn_t *conn)
last_rcv = conn->ksnc_rx_deadline -
cfs_time_seconds(*ksocknal_tunables.ksnd_timeout);
CERROR("Completing partial receive from %s[%d]"
", ip %d.%d.%d.%d:%d, with error, wanted: %d, left: %d, "
", ip %pI4h:%d, with error, wanted: %d, left: %d, "
"last alive is %ld secs ago\n",
libcfs_id2str(conn->ksnc_peer->ksnp_id), conn->ksnc_type,
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port,
&conn->ksnc_ipaddr, conn->ksnc_port,
conn->ksnc_rx_nob_wanted, conn->ksnc_rx_nob_left,
cfs_duration_sec(cfs_time_sub(cfs_time_current(),
last_rcv)));
Expand All @@ -1661,25 +1661,25 @@ ksocknal_destroy_conn (ksock_conn_t *conn)
case SOCKNAL_RX_LNET_HEADER:
if (conn->ksnc_rx_started)
CERROR("Incomplete receive of lnet header from %s"
", ip %d.%d.%d.%d:%d, with error, protocol: %d.x.\n",
", ip %pI4h:%d, with error, protocol: %d.x.\n",
libcfs_id2str(conn->ksnc_peer->ksnp_id),
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port,
&conn->ksnc_ipaddr, conn->ksnc_port,
conn->ksnc_proto->pro_version);
break;
case SOCKNAL_RX_KSM_HEADER:
if (conn->ksnc_rx_started)
CERROR("Incomplete receive of ksock message from %s"
", ip %d.%d.%d.%d:%d, with error, protocol: %d.x.\n",
", ip %pI4h:%d, with error, protocol: %d.x.\n",
libcfs_id2str(conn->ksnc_peer->ksnp_id),
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port,
&conn->ksnc_ipaddr, conn->ksnc_port,
conn->ksnc_proto->pro_version);
break;
case SOCKNAL_RX_SLOP:
if (conn->ksnc_rx_started)
CERROR("Incomplete receive of slops from %s"
", ip %d.%d.%d.%d:%d, with error\n",
", ip %pI4h:%d, with error\n",
libcfs_id2str(conn->ksnc_peer->ksnp_id),
HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
&conn->ksnc_ipaddr, conn->ksnc_port);
break;
default:
LBUG ();
Expand Down
Loading

0 comments on commit 5e8f692

Please sign in to comment.