mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* bitmaps/bitops
@ 2003-03-15 21:09 Randy.Dunlap
  2003-03-15 21:51 ` bitmaps/bitops Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Randy.Dunlap @ 2003-03-15 21:09 UTC (permalink / raw)
  To: linux-kernel

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




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

end of thread, other threads:[~2003-03-16 20:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2003-03-15 21:09 bitmaps/bitops Randy.Dunlap
2003-03-15 21:51 ` bitmaps/bitops Geert Uytterhoeven

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®