Skip to contentSkip to conversation

dump.c: In mad_dump_linkwidth, output undefined widths

PATCH Applied Hal Rosenstock 2 participants 2 messages Apr 15, 2014 – Apr 19, 2014 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dump.c: In mad_dump_linkwidth, output undefined widths

Based on patch for this for width 0 from Ammar Haj Hamad <ahamad-DMD6N21cJuFWk0Htik3J/[email protected]>

Some implementations when port is down appear to return a link width of 0

---

src/dump.c +2 -1
index 7f3ef7d..efe4bc4 100644
@@ -185,7 +185,8 @@ void mad_dump_linkwidth(char *buf, int bufsz, void *val, int valsz)
 		break;
 	default:
 		IBWARN("bad width %d", width);
-		buf[0] = 0;
+		snprintf(buf, bufsz, "undefined (%d)", width);
+		break;
 	}
 }
 

--
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): 534D6DE1.4010306-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

Applied
#2 lore raw
Quoted 8 lines

Based on patch for this for width 0 from Ammar Haj Hamad <ahamad-DMD6N21cJuFWk0Htik3J/[email protected]>

Some implementations when port is down appear to return a link width of 0

Thanks applied,
Ira

Quoted 7 lines

---

src/dump.c +0 -0
index 7f3ef7d..efe4bc4 100644

src/dump.c void mad_dump_linkwidth(char *buf, int bufsz, void · line 192

Quoted 9 lines
src/dump.c +2 -1
@@ -185,7 +185,8 @@ void mad_dump_linkwidth(char *buf, int bufsz, void
 *val, int valsz)
 		break;
 	default:
 		IBWARN("bad width %d", width);
-		buf[0] = 0;
+		snprintf(buf, bufsz, "undefined (%d)", width);
+		break;
 	}
 }

--
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