Re: [PATCH] Futexes IV (Fast Lightweight Userspace Semaphores)

From: Davide Libenzi (davidel@xmailserver.org)
Date: Tue Mar 05 2002 - 17:39:53 EST


On Tue, 5 Mar 2002, Rusty Russell wrote:

> + pos_in_page = ((unsigned long)uaddr) % PAGE_SIZE;
> +
> + /* Must be "naturally" aligned, and not on page boundary. */
> + if ((pos_in_page % __alignof__(atomic_t)) != 0
> + || pos_in_page + sizeof(atomic_t) > PAGE_SIZE)
> + return -EINVAL;

How can this :

        (pos_in_page % __alignof__(atomic_t)) != 0

to be false, and together this :

        pos_in_page + sizeof(atomic_t) > PAGE_SIZE

to be true ?
This is enough :

        if ((pos_in_page % __alignof__(atomic_t)) != 0)

- Davide

-
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/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:48 EST