From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: Re: [PATCH v2] fs: O_* bit numbers uniqueness check Date: Tue, 05 Jan 2010 23:30:31 -0800 Message-ID: References: <20100106065526.GB11368@localhost> <20100106071817.GA24428@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , David Miller , Stephen Rothwell , Al Viro , Christoph Hellwig , Eric Paris , LKML , "linux-fsdevel\@vger.kernel.org" To: Wu Fengguang Return-path: In-Reply-To: <20100106071817.GA24428@localhost> (Wu Fengguang's message of "Wed, 6 Jan 2010 15:18:17 +0800") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org > Yeah, I chose the boot time check because of hweight32().. One could do something like #define HWEIGHT32(x) (!!((x) & (1u << 0)) + !!((x) & (1u << 1)) + //... !!((x) & (1u << 31))); that would probably work with BUILD_BUG_ON(). But as I said maybe it's too ugly. - R.