Skip to contentSkip to conversation

ibacm/acm.c: LID format should be unsigned decimal

PATCH In review Hal Rosenstock 2 participants 2 messages Apr 6, 2012 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibacm/acm.c: LID format should be unsigned decimal

so that unicast LIDs >= 0x8000 and < 0xc000 display as positive rather than negative numbers.

---

src/acm.c +2 -2
index d47f9d6..e17b8a6 100644
@@ -267,7 +267,7 @@ acm_format_name(int level, char *name, size_t name_size,
 	case ACM_EP_INFO_PATH:
 		path = (struct ibv_path_record *) addr;
 		if (path->dlid) {
-			sprintf(name, "SLID(%d) DLID(%d)",
+			sprintf(name, "SLID(%u) DLID(%u)",
 				ntohs(path->slid), ntohs(path->dlid));
 		} else {
 			acm_format_name(level, name, name_size, ACM_ADDRESS_GID,
@@ -275,7 +275,7 @@ acm_format_name(int level, char *name, size_t name_size,
 		}
 		break;
 	case ACM_ADDRESS_LID:
-		sprintf(name, "LID(%d)", ntohs(*((uint16_t *) addr)));
+		sprintf(name, "LID(%u)", ntohs(*((uint16_t *) addr)));
 		break;
 	default:
 		strcpy(name, "Unknown");

--
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): 4F7EF01E.8020300-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org