From: Richard Knutsson <ricknu-0@student.ltu.se>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Milind Arun Choudhary <milindchoudhary@gmail.com>,
kernel-janitors@lists.osdl.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [KJ][PATCH] BIT macro cleanup
Date: Thu, 29 Mar 2007 05:28:04 +0200 [thread overview]
Message-ID: <460B3244.9060405@student.ltu.se> (raw)
In-Reply-To: <20070328190925.GC5306@martell.zuzino.mipt.ru>
Alexey Dobriyan wrote:
> On Wed, Mar 28, 2007 at 09:03:09AM +0530, Milind Arun Choudhary wrote:
>
>> --- a/include/linux/bitops.h
>> +++ b/include/linux/bitops.h
>> @@ -8,6 +8,9 @@
>> */
>> #include <asm/bitops.h>
>>
>> +#define BIT(nr) (1UL << ((nr) % BITS_PER_LONG))
>>
>
> I think this would be a disaster because something like
>
> BIT(123)
>
> would not even generate a warning.
>
There were a discussion on this, at KJ, when BIT was first used with a
modular operation. I said the same thing as you do now, but a big user
of BIT is the input-subsystem who defined their BIT as above. Also it
was mentioned that the compiler can only find the statical errors, a
variable input can break it in runtime.
+ if we _really_ want to check the tree for such warnings, it is easy to
remove the modular operation temporarily (and keep away of input/)
I don't say I like this, just that it is a choose between possible errors.
Richard Knutsson
next prev parent reply other threads:[~2007-03-29 3:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 3:33 [KJ][PATCH] BIT macro cleanup Milind Arun Choudhary
2007-03-28 19:09 ` Alexey Dobriyan
2007-03-29 3:28 ` Richard Knutsson [this message]
2007-03-30 12:31 ` Milind Arun Choudhary
2007-03-29 3:48 ` Richard Knutsson
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=460B3244.9060405@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=milindchoudhary@gmail.com \
/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