From: Jeff Garzik <jgarzik@pobox.com>
To: acme@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: bit testing nervousness...
Date: Sun, 8 Dec 2002 22:54:00 -0500 [thread overview]
Message-ID: <20021209035400.GA20470@gtf.org> (raw)
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
next reply other threads:[~2002-12-09 3:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-09 3:54 Jeff Garzik [this message]
2002-12-09 7:35 ` bit testing nervousness Arnaldo Carvalho de Melo
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=20021209035400.GA20470@gtf.org \
--to=jgarzik@pobox.com \
--cc=acme@conectiva.com.br \
--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