mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: <linux-kernel@vger.kernel.org>
Subject: bitmaps/bitops
Date: Sat, 15 Mar 2003 13:09:33 -0800 (PST)	[thread overview]
Message-ID: <33987.4.64.238.61.1047762573.squirrel@www.osdl.org> (raw)

Hi,

Not picking on this code, but as an example:

drivers/ieee1394/ieee1394_transactions.c, line 152 (in 2.5.64),
uses:  test_and_set_bit(bit_number, tp->pool),

where tp->pool is declared by using a DECLARE_BITMAP(), like so:
struct hpsb_tlabel_pool {
	DECLARE_BITMAP(pool, 64);

That makes sense (at least to me), but gcc complains about the
type of <pool> when used in test_and_set_bit():
  drivers/ieee1394/ieee1394_transactions.c:152: warning: passing arg 2 of
`test_and_set_bit' from incompatible pointer type

Is this an error, a bug, a nuisance, or just another "ignore gcc 2.96"
problem?

For reference, DECLARE_BITMAP() generates an array of unsigned longs:
#define DECLARE_BITMAP(name,bits) \
	unsigned long name[BITS_TO_LONGS(bits)]
but the prototype for test_and_set_bit() depends on $(ARCH), and it's
not consistent, with the second arg (bitmap address) being one of:
  volatile void *
  void *
  volatile unsigned long *


If there's (kernel) surgery required here, unless it's trivial, I think
that I'd leave it for early 2.7.

~Randy




             reply	other threads:[~2003-03-15 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-15 21:09 Randy.Dunlap [this message]
2003-03-15 21:51 ` bitmaps/bitops Geert Uytterhoeven
     [not found] <mailman.1047762781.3457.linux-kernel2news@redhat.com>
2003-03-16  1:31 ` bitmaps/bitops Pete Zaitcev
2003-03-16  1:41   ` bitmaps/bitops Paul Mackerras
2003-03-16 21:42   ` bitmaps/bitops Alan Cox

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=33987.4.64.238.61.1047762573.squirrel@www.osdl.org \
    --to=rddunlap@osdl.org \
    --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

all inboxes | Powered by JetHome®