public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Dubov <oakad@yahoo.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Problem with find_first_bit function and kin
Date: Sat, 16 Aug 2008 12:26:54 -0700 (PDT)	[thread overview]
Message-ID: <865989.50481.qm@web37602.mail.mud.yahoo.com> (raw)

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?



      

             reply	other threads:[~2008-08-16 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 19:26 Alex Dubov [this message]
2008-08-17 11:58 ` Problem with find_first_bit function and kin Alexander van Heukelum
2008-08-18  2:22   ` Alex Dubov
2008-08-18  6:53     ` Alexander van Heukelum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=865989.50481.qm@web37602.mail.mud.yahoo.com \
    --to=oakad@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox