[infiniband-core] question about arguments position

From: Gustavo A. R. Silva
Date: Thu May 04 2017 - 13:42:23 EST

Hello everybody,

While looking into Coverity ID 1351047 I ran into the following piece of code at drivers/infiniband/core/verbs.c:496:

ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid,
wc->wc_flags & IB_WC_WITH_VLAN ?
NULL : &vlan_id,
&if_index, &hoplimit);

The issue here is that the position of arguments in the call to rdma_addr_find_l2_eth_by_grh() function do not match the order of the parameters:

&dgid is passed to sgid
&sgid is passed to dgid

This is the function prototype:

int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
const union ib_gid *dgid,
u8 *dmac, u16 *vlan_id, int *if_index,
int *hoplimit)

My question here is if this is intentional?

In case it is not, I will send a patch to fix it. But first it would be great to hear any comment about it.

Thank you
Gustavo A. R. Silva