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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 24 Feb 2007 22:39:32 -0500
From:	Dmitry Torokhov <dtor@...ightbb.com>
To:	linux-joystick@...ey.karlin.mff.cuni.cz
Cc:	Richard Knutsson <ricknu-0@...dent.ltu.se>,
	Vojtech Pavlik <vojtech@...e.cz>,
	Milind Choudhary <milindchoudhary@...il.com>,
	kernel-janitors@...ts.osdl.org, linux-kernel@...r.kernel.org,
	linux-input@...ey.karlin.mff.cuni.cz
Subject: Re: [KJ][RFC][PATCH] BIT macro cleanup

On Saturday 24 February 2007 07:59, Richard Knutsson wrote:
> Vojtech Pavlik wrote:
> > On Fri, Feb 23, 2007 at 11:43:44PM +0100, Richard Knutsson wrote:
> >
> >   
> >> Is the reason for the modulo to put a bitmask larger then the variable 
> >> into an array?
> >>     
> >
> > The complementary LONG() macro will tell you the index of an array of
> > longs where the bit should be set.
> >   
> This may be a little OT, but how come it is not done as an function? 
> Maybe something like "(set/get)_long_mask(...)".

We have it. Is is called set_bit (or __set_bit) and works wery well for
single bit operations, but sometimes it is nice to be able to write

	a = BIT(b) | BIT(c); 

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