Re: [PATCH] byteorder: force in-place endian conversion to alwaysevaluate args

From: H. Peter Anvin
Date: Fri Jul 25 2008 - 14:58:55 EST


Harvey Harrison wrote:
For what it's worth, the way to write a macro like this:

#define __cpu_to_be64s(x) ((void)(x))

If you've looked at the byteorder rework I've done in -mm, these get
unified in a single include/linux/byteorder.h and look like:

[inline functions]

What I meant with the above, was that it seems poorly understood how to write an empty "function-like" macro.

Obviously, inline functions don't have this problem, and is generally better anyway (type-safe even in the empty condition, for example.)

-hpa

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