On Tue, 2007-11-20 at 21:56 +0800, Herbert Xu wrote:
Perhaps this should use is_power_of_2?
#define IS_ALIGNED(x, a) \
({ typeof(x) _a = (typeof(x))(a); \
is_power_of_2(_a) ? (((x) & (_a - 1)) == 0) \
: (((x) % _a == 0); })
gcc -o2/oS seems to do the right thing.
-