From: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
To: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: "parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-core] mlx4: Fix 1<<31 expressions
Date: Fri, 9 Feb 2018 09:18:56 -0800 [thread overview]
Message-ID: <c5a3a5fd-dfc6-3fa0-a55e-91c121f8ae68@wdc.com> (raw)
In-Reply-To: <20180209162453.GD7584-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On 02/09/18 08:24, Jason Gunthorpe wrote:
> On Fri, Feb 09, 2018 at 04:19:23PM +0000, Bart Van Assche wrote:
>> On Fri, 2018-02-09 at 16:12 +0000, Parav Pandit wrote:
>>> Any reason to use open code instead of using BIT() macro from
>>> include/linux/bitops.h which does the same thing?
>>
>> Personally I'm in favor of removing the BIT() macro from the kernel. That macro
>> is not useful and only adds confusion. Code that does not use that macro is
>> easier to read because one does not have to look up whether the BIT() macro
>> is defined as 1U << x, 1UL << x or 1ULL << x.
>
> Really? The rule is pretty simple:
>
> BIT(x) for x < 32
> BIT_ULL(x) for x >= 32 && x < 64
>
> Why do you care about what specific type the macro produces?
That's something additional kernel developers have to memorize. If the
BIT() macro is not used but the shift operation is explicit then that
saves the lookup of the BIT() definition in case one would have
forgotten what the BIT() definition looks like.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-02-09 17:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 23:38 [PATCH rdma-core] mlx4: Fix 1<<31 expressions Jason Gunthorpe
[not found] ` <20180208233829.GA16128-uk2M96/98Pc@public.gmane.org>
2018-02-09 16:01 ` Bart Van Assche
[not found] ` <1518192109.2871.5.camel-Sjgp3cTcYWE@public.gmane.org>
2018-02-09 16:10 ` Jason Gunthorpe
[not found] ` <20180209161030.GA7584-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-02-09 16:12 ` Parav Pandit
[not found] ` <HE1PR0502MB3004BB45FC9ADB9B49CAF283D1F20-692Kmc8YnlL9PhveBwpv4cDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-02-09 16:13 ` Jason Gunthorpe
[not found] ` <20180209161325.GD7570-uk2M96/98Pc@public.gmane.org>
2018-02-09 16:20 ` Parav Pandit
2018-02-09 16:42 ` Leon Romanovsky
[not found] ` <20180209164200.GO2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-02-09 16:51 ` Jason Gunthorpe
[not found] ` <20180209165138.GA11850-uk2M96/98Pc@public.gmane.org>
2018-02-09 16:55 ` Leon Romanovsky
2018-02-09 16:19 ` Bart Van Assche
[not found] ` <1518193161.2871.14.camel-Sjgp3cTcYWE@public.gmane.org>
2018-02-09 16:24 ` Jason Gunthorpe
[not found] ` <20180209162453.GD7584-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-02-09 17:18 ` Bart Van Assche [this message]
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=c5a3a5fd-dfc6-3fa0-a55e-91c121f8ae68@wdc.com \
--to=bart.vanassche-sjgp3ctcywe@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).