Hmm. I am not precisely happy with improvements like

-               ptr[4] = MSB_of(info->pagesize>>16);
-               ptr[5] = LSB_of(info->pagesize>>16);
-               ptr[6] = MSB_of(info->pagesize&0xFFFF);
-               ptr[7] = LSB_of(info->pagesize&0xFFFF);
+               ((u32 *) ptr)[1] = cpu_to_be32(info->pagesize);

A good compiler generates the same code, and for a human
like me the above four statements show much more clearly
that values are assigned to ptr[4..7] than the ugly cast below.

And

> +                       ((u16*)ptr)[0] = sizeof(mode_page_01) - 2;

looks like a bug. This (u16*) will work or not, depending on
whether the machine is big or little-endian.

No obfuscation please.

Andries


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to