Re: Constant byteorder macros.

From: David Woodhouse (dwmw2@infradead.org)
Date: Thu Jan 20 2000 - 07:59:49 EST


hpa@transmeta.com said:
> Given that gcc has a __builtin_constant_p(x), you ought to be able to
> do:

> #define cpu_to_le16(x) ( __builtin_constant_p(x) ? \
> __constant_cpu_to_le16(x) : __cpu_to_le16(x) )

I didn't really explore this avenue very deeply - I assumed that because it's
been done with a separate __constant_x macro in the htonl() case, there was a
problem with doing it in the way you suggest.

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:23 EST