On Feb 9, 2008 9:27 AM, Christoph Hellwig <[EMAIL PROTECTED]> wrote: > On Sat, Feb 09, 2008 at 07:35:07AM -0600, [EMAIL PROTECTED] wrote: > > +#ifdef __BIG_ENDIAN > > + *buf++ = hexchars[(tmp_s >> 12) & 0xf]; > > + *buf++ = hexchars[(tmp_s >> 8) & 0xf]; > > + *buf++ = hexchars[(tmp_s >> 4) & 0xf]; > > + *buf++ = hexchars[tmp_s & 0xf]; > > +#else > > + *buf++ = hexchars[(tmp_s >> 4) & 0xf]; > > + *buf++ = hexchars[tmp_s & 0xf]; > > + *buf++ = hexchars[(tmp_s >> 12) & 0xf]; > > + *buf++ = hexchars[(tmp_s >> 8) & 0xf]; > > +#endif > > This is really ugly, but I don't really know a good way around it > either.
void u32_to_hex(u32 val, unsigned char *buf) { int i; for (i=7; i>=0; i--) { buf[i] = hexchars[ val & 0x0f ]; val >>= 4; } } u32_to_hex(tmp_s, buf); buf += 8; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/