Skip to contentSkip to conversation

infiniband-diags/saquery.c: Modify dump_path_record

PATCH Applied Hal Rosenstock 2 participants 2 messages Oct 13, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband-diags/saquery.c: Modify dump_path_record

Similar to commit 27ea3c85500f7eff741c93e662a344742dbbea13 to fix gcc-4.4.1 warnings

Fix "dereferencing type-punned pointer will break strict-aliasing rules" warning catched by gcc-4.4.1.

---

infiniband-diags/src/saquery.c +3 -3
index d880261..6c44b63 100644
@@ -312,8 +312,7 @@ static void dump_path_record(void *data)
 	       "\t\trate....................0x%X\n"
 	       "\t\tpkt_life................0x%X\n"
 	       "\t\tpreference..............0x%X\n"
-	       "\t\tresv2...................0x%X\n"
-	       "\t\tresv3...................0x%X\n",
+	       "\t\tresv2...................0x%02X%02X%02X%02X%02X%02X\n",
 	       cl_ntoh64(p_pr->service_id),
 	       inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str, sizeof gid_str),
 	       inet_ntop(AF_INET6, p_pr->sgid.raw, gid_str2, sizeof gid_str2),
@@ -322,7 +321,8 @@ static void dump_path_record(void *data)
 	       cl_ntoh16(p_pr->pkey), ib_path_rec_qos_class(p_pr),
 	       ib_path_rec_sl(p_pr), p_pr->mtu, p_pr->rate, p_pr->pkt_life,
 	       p_pr->preference,
-	       *(uint32_t *) & p_pr->resv2, *((uint16_t *) & p_pr->resv2 + 2));
+	       p_pr->resv2[0], p_pr->resv2[1], p_pr->resv2[2],
+	       p_pr->resv2[3], p_pr->resv2[4], p_pr->resv2[5]);
 }
 
 static void dump_class_port_info(void *data)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 9 lines · Hal Rosenstock

Similar to commit 27ea3c85500f7eff741c93e662a344742dbbea13 to fix gcc-4.4.1 warnings

Fix "dereferencing type-punned pointer will break strict-aliasing rules" warning catched by gcc-4.4.1.

Applied. Thanks.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html