All of lore.kernel.org
 help / color / mirror / Atom feed
* bit testing nervousness...
@ 2002-12-09  3:54 Jeff Garzik
  2002-12-09  7:35 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2002-12-09  3:54 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel

Hey...

WRT all these test_bit()/set_bit() cleanups.   I am a bit nervous about
these changes that are coming in...

When I see types change from "u8" or "u32" to "long" just to make
<foo>_bit() work, that really makes me think that cleanup is wrong.  I
haven't looked closely at the recent set_bit() cleanups yet, but I am
willing to bet that at least some of them are wrongly changing the size
of a variable's type.

My preference would be to _eliminate_ the set_bit call and simply
open-code the bitop, i.e.
	set_bit(bitnum, &foo);
become
	foo |= (1 << bitnum);
	
Really, for each cleanup, you need to look hard at the change and
see if <foo>_bit() is being used for atomicity reasons or simply
programmer preference.  (and other issues like endian issues)  The
latter can easily be changed to open-coding.

Disclaimer, my argument is null and void if each change has been closely
studied and is really correct :)  However I'm guessing we all are only
glancing at the changes :)

	Jeff




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

end of thread, other threads:[~2002-12-09  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-09  3:54 bit testing nervousness Jeff Garzik
2002-12-09  7:35 ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.