lkml.org 
[lkml]   [2009]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/19] workqueue: update cwq alignement and make one more flag bit available
On Thu, 01 Oct 2009 14:05:20 +0100
David Howells <dhowells@redhat.com> wrote:

> Tejun Heo <tj@kernel.org> wrote:
>
> > +enum {
> > + WORK_STRUCT_PENDING = 0, /* work item is pending execution */
> > +
> > + /*
> > + * Reserve 3bits off of cwq pointer. This is enough and
> > + * provides acceptable alignment on both 32 and 64bit
> > + * machines.
> > + */
> > + WORK_STRUCT_FLAG_BITS = 3,
> > +
> > + WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
> > + WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK,
> > +};
>
> There's some great enum abuse going on here:-)

Its actually a very sensible use of enum - enum constants don't contain
the deathtraps that CPP constants do.

Alan


\
 
 \ /
  Last update: 2009-10-01 18:47    [W:0.142 / U:0.180 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site