[openib-general] CM convert_to_ms typo

Roland Dreier roland at topspin.com
Thu Jan 27 14:20:59 PST 2005


Holy Canoli, that's an obfuscated way to write that!  uint isn't
really favored as a type to use (just use "unsigned" if you want an
unsigned integer).  In any case, I think it might be clearer to write
this as:

	static inline int cm_convert_to_ms(int iba_time)
	{
	        return 1 << max(iba_time - 8, 0);
	}

I'm pretty sure that ordinary promotion/conversion rules should make
this work even when called with as parameter.

 - R.



More information about the general mailing list