RDMA: Fix compilation warning

Infiniband.cc: In member function ‘int Infiniband::recv_msg(CephContext*, int, IBSYNMsg&)’:
Infiniband.cc:883:86: warning: format ‘%x’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘uint16_t* {aka short unsigned int*}’ [-Wformat=]
     sscanf(msg, "%x:%x:%x:%x:%s", &(im.lid), &(im.qpn), &(im.psn),
     &(im.peer_qpn),gid);

Signed-off-by: Amir Vadai <amir@vadai.me>
This commit is contained in:
Amir Vadai 2017-01-02 10:57:15 +02:00
parent 3662403e99
commit 194bc3cb5f

View File

@ -880,7 +880,10 @@ int Infiniband::recv_msg(CephContext *cct, int sd, IBSYNMsg& im)
ldout(cct, 1) << __func__ << " got bad length (" << r << "): " << cpp_strerror(errno) << dendl;
r = -EINVAL;
} else { // valid message
sscanf(msg, "%x:%x:%x:%x:%s", &(im.lid), &(im.qpn), &(im.psn), &(im.peer_qpn),gid);
int tmp;
sscanf(msg, "%x:%x:%x:%x:%s", &tmp, &(im.qpn), &(im.psn), &(im.peer_qpn),gid);
im.lid = tmp;
wire_gid_to_gid(gid, &(im.gid));
ldout(cct, 5) << __func__ << " recevd: " << im.lid << ", " << im.qpn << ", " << im.psn << ", " << im.peer_qpn << ", " << gid << dendl;
}