Skip to content

Commit 6734b29

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
RDMA/hns: Fix bad endianess of port_pd variable
port_pd is treated as le32 in declaration and read, fix assignment to be in le32 too. This change fixes the following compilation warnings. drivers/infiniband/hw/hns/hns_roce_ah.c:67:24: warning: incorrect type in assignment (different base types) drivers/infiniband/hw/hns/hns_roce_ah.c:67:24: expected restricted __le32 [usertype] port_pd drivers/infiniband/hw/hns/hns_roce_ah.c:67:24: got restricted __be32 [usertype] Fixes: 9a44353 ("IB/hns: Add driver files for hns RoCE driver") Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Gal Pressman <[email protected]> Reviewed-by: Lijun Ou <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent ff23dfa commit 6734b29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_ah.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct ib_ah *hns_roce_create_ah(struct ib_pd *ibpd,
7070
HNS_ROCE_VLAN_SL_BIT_MASK) <<
7171
HNS_ROCE_VLAN_SL_SHIFT;
7272

73-
ah->av.port_pd = cpu_to_be32(to_hr_pd(ibpd)->pdn |
73+
ah->av.port_pd = cpu_to_le32(to_hr_pd(ibpd)->pdn |
7474
(rdma_ah_get_port_num(ah_attr) <<
7575
HNS_ROCE_PORT_NUM_SHIFT));
7676
ah->av.gid_index = grh->sgid_index;

0 commit comments

Comments
 (0)