lkml.org 
[lkml]   [2002]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Futexes IV (Fast Lightweight Userspace Semaphores)
On Tue, 5 Mar 2002, Hubertus Franke wrote:

> On Tuesday 05 March 2002 05:39 pm, Davide Libenzi wrote:
> > 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)
> >
> >
>
> I believe not all machine have alignof == sizeof

Yes but this is always true alignof >= sizeof




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

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.113 / U:1.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site