Re: [KJ][RFC][PATCH] BIT macro cleanup
From: Dmitry Torokhov <hidden>
Date: 2007-02-25 03:41:45
Also in:
kernel-janitors, lkml
From: Dmitry Torokhov <hidden>
Date: 2007-02-25 03:41:45
Also in:
kernel-janitors, lkml
On Saturday 24 February 2007 07:59, Richard Knutsson wrote:
Vojtech Pavlik wrote:quoted
On Fri, Feb 23, 2007 at 11:43:44PM +0100, Richard Knutsson wrote:quoted
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