lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091001173955.524b2bc6@lxorguk.ukuu.org.uk>
Date:	Thu, 1 Oct 2009 17:39:55 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	David Howells <dhowells@...hat.com>
Cc:	Tejun Heo <tj@...nel.org>, dhowells@...hat.com, jeff@...zik.org,
	mingo@...e.hu, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, jens.axboe@...cle.com,
	rusty@...tcorp.com.au, cl@...ux-foundation.org,
	arjan@...ux.intel.com
Subject: Re: [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@...hat.com> wrote:

> Tejun Heo <tj@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ