[PATCH] libmlx4: Fix a compiler warning

Bart Van Assche
2011-10-10T17:47:33Z

src/verbs.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/verbs.c b/src/verbs.c
index 199d107..28d8585 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -616,12 +616,10 @@ int mlx4_destroy_qp(struct ibv_qp *ibqp)

static int link_local_gid(const union ibv_gid *gid)
{
- uint32_t hi = *(uint32_t *)(gid->raw);
- uint32_t lo = *(uint32_t *)(gid->raw + 4);
- if (hi == htonl(0xfe800000) && lo == 0)
- return 1;
+ uint32_t hi = gid->u32[0];
+ uint32_t lo = gid->u32[1];

- return 0;
+ return hi == htonl(0xfe800000) && lo == 0;
}

static uint16_t get_vlan_id(union ibv_gid *gid)
--
1.7.3.4