public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Problem with find_first_bit function and kin
@ 2008-08-16 19:26 Alex Dubov
  2008-08-17 11:58 ` Alexander van Heukelum
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Dubov @ 2008-08-16 19:26 UTC (permalink / raw)
  To: Linux kernel mailing list

It's well may be that I'm just missing something obvious.

It seems to me that find_first_bit/find_next_bit functions return their
offsets "base 1" - first set bit is "1" and last is "bitmap size". This
means that if only the last bit in the bitmap is set, the returned value
will be indistinguishable from no bits set situation. Moreover, bit
manipulation functions appear to use "base 0" bit addresses, adding to the
inconvenience.

Is this a desired behavior? And, if yes, how is one supposed to deal with last bit of the bitmap?



      

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-18  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-16 19:26 Problem with find_first_bit function and kin Alex Dubov
2008-08-17 11:58 ` Alexander van Heukelum
2008-08-18  2:22   ` Alex Dubov
2008-08-18  6:53     ` Alexander van Heukelum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox