Thread (19 messages) 19 messages, 5 authors, 2007-02-25

Re: [KJ][RFC][PATCH] BIT macro cleanup

From: Richard Knutsson <hidden>
Date: 2007-02-24 12:59:57
Also in: kernel-janitors, lkml

Vojtech Pavlik wrote:
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(...)".
  
quoted
The reason I don't like it with modulo is simply because it hides 
potential bugs (when x is to big). 
    
That would be my only concern - losing compiler warnings.
  
And what bugs me is that this will effect the whole tree for a feature 
used in only input, right?
  
quoted
And what about the "1%"?
    
The 1% will need either LLBIT or an extra % 8.
  
Oh, that's true

Richard Knutsson
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help