Alex Davis wrote: >>short swap16(short in) >>{ >> int i; >> short out=0; >> for (i=0; i<4; i++) { >> out = out<<8 | (in&255); >> in = in >> 8; >> } >> return out; >>} > > Shouldn't that be "for (i=0; i<2; i++) {..." ? In which case, do we really need this complexity rather than a clear swap, e.g. return (short)(((in&0x0ff)<<8) | ((in>>8)&0x0ff)) Simple enough for a macro too. -- Eyal Lebedinsky (eyal@xxxxxxxxxxxxxx) <http://samba.org/eyal/> attach .zip as .dat - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html