From: Bart Van Assche Date: Mon, 2 Jul 2018 17:06:51 +0000 (-0700) Subject: include/rdma/opa_addr.h: Fix an endianness issue X-Git-Tag: v4.19~309^2~226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4eefd62c17a9a5e7576207e84f3d2b4f73aba750;p=platform%2Fkernel%2Flinux-rpi.git include/rdma/opa_addr.h: Fix an endianness issue IB_MULTICAST_LID_BASE is defined as follows: #define IB_MULTICAST_LID_BASE cpu_to_be16(0xC000) Hence use be16_to_cpu() to convert it to CPU endianness. Compile-tested only. Fixes: af808ece5ce9 ("IB/SA: Check dlid before SA agent queries for ClassPortInfo") Signed-off-by: Bart Van Assche Cc: Venkata Sandeep Dhanalakota Cc: Mike Marciniszyn Cc: Dennis Dalessandro Signed-off-by: Jason Gunthorpe --- diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h index 2bbb7a6..66d4393 100644 --- a/include/rdma/opa_addr.h +++ b/include/rdma/opa_addr.h @@ -120,7 +120,7 @@ static inline bool rdma_is_valid_unicast_lid(struct rdma_ah_attr *attr) if (attr->type == RDMA_AH_ATTR_TYPE_IB) { if (!rdma_ah_get_dlid(attr) || rdma_ah_get_dlid(attr) >= - be32_to_cpu(IB_MULTICAST_LID_BASE)) + be16_to_cpu(IB_MULTICAST_LID_BASE)) return false; } else if (attr->type == RDMA_AH_ATTR_TYPE_OPA) { if (!rdma_ah_get_dlid(attr) ||