[openib-general] CM convert_to_ms typo

Libor Michalek libor at topspin.com
Thu Jan 27 14:00:14 PST 2005


Sean,

  Found what looks like a typo in cm_convert_to_ms() should be max()
instead of min() for converting to milliseconds.

-Libor


Index: core/cm.c
===================================================================
--- core/cm.c	(revision 1679)
+++ core/cm.c	(working copy)
@@ -671,7 +671,7 @@
 static inline int cm_convert_to_ms(u8 iba_time)
 {
 	/* approximate conversion to ms from 4.096us x 2^iba_time */
-	return (1 << ((uint)min(iba_time, (u8) 8) - (uint)8));
+	return (1 << ((uint)max(iba_time, (u8) 8) - (uint)8));
 }
 
 static void cm_format_mad_hdr(struct ib_mad_hdr *hdr,



More information about the general mailing list