]> git.baikalelectronics.ru Git - kernel.git/commit
Fix 'ALIGN()' macro, take 2
authorLinus Torvalds <torvalds@woody.osdl.org>
Mon, 27 Nov 2006 03:05:22 +0000 (19:05 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Mon, 27 Nov 2006 03:05:22 +0000 (19:05 -0800)
commit87fb5ded915462e4f48f510c2b4f13a708b8825d
treee8c8bf721cc917c8842c4a007ad4b3f68eb7aa1e
parent7710547f5e605cb696245d9c9c7ae58f8d0bff12
Fix 'ALIGN()' macro, take 2

You wouldn't think that doing an ALIGN() macro that aligns something up
to a power-of-two boundary would be likely to have bugs, would you?

But hey, in the wonderful world of mixing integer types, you have to be
careful.  This just makes sure that the alignment is interpreted in the
same type as the thing to be aligned.

Thanks to Roland Dreier, who noticed that the amso1100 driver got broken
by the previous fix (that just extended the mask to "unsigned long", but
was still broken in "unsigned long long" - it just happened to be the
same on 64-bit architectures).

See commit aba619e9084f92ff7a987c7099e96da11e03c59a for the history of
bugs here...

Acked-by: Roland Dreier <rdreier@cisco.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: David Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/kernel.h