Um, this test existed for a reason:
> - /* Must be "naturally" aligned, and not on page boundary. */
> - if ((pos_in_page % __alignof__(int)) != 0
> - || pos_in_page + sizeof(int) > PAGE_SIZE)
> + /* Must be "naturally" aligned */
> + if (pos_in_page % sizeof(int))
> return -EINVAL;
If you do this, *please* add:
/* Above check not sufficient if align of int < size. Break link. */
if (__alignof__(int) < sizeof(int)) {
extern void __error_small_int_align();
__error_small_int_align();
}
Cheers,
Rusty.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/