On Tue, Nov 13, 2007 at 07:38:43AM -0800, Hal Rosenstock wrote:
> libibmad/dump.c: Support link speed and width vendor extensions
> 
> When decoding values, handle vendor extensions to link speed and width
> including accommodating a "documentation" change between IBA 1.2 and
> 1.2.1

Isn't this better done with a bitmap match?

const unsigned int widths[] = {1,4,8,12};

char S[300];
int off = 0;
for (unsigned int I = 0; I != sizeof(width)/sizeof(width[0]) && off < 
sizeof(S); I++)
   if ((width >> I) & 1)
      off += snprintf(S,sizeof(S)-off,"%uX ",widths[I]);

Regards,
Jason
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to