All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Jagan Teki <jteki@openedev.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [PATCH] block: Use BIT macro from include/linux/bitops.h
Date: Wed, 20 May 2015 13:43:00 -0600	[thread overview]
Message-ID: <555CE3C4.7010406@kernel.dk> (raw)
In-Reply-To: <CAD6G_RS=vrvLT0ZC5+2NRacMoSJTvUYD0EezuZvOZn13=JbBsQ@mail.gmail.com>

On 05/20/2015 01:41 PM, Jagan Teki wrote:
> On 21 May 2015 at 00:52, Jens Axboe <axboe@kernel.dk> wrote:
>> On 05/18/2015 01:14 PM, Jagan Teki wrote:
>>>
>>> Replace (1 << nr) to BIT(nr) where nr = 0, 1, 2 .... 31
>>
>>
>> I don't like it, I think it hurts readability.
>
> What do you mean by don't like, using kernel defined macro instead of
> numerical assignments huts readability?

In the context of the patch, BIT(0) == (1 << 0) is obvious. But if I 
just came across BIT(7) in the code, I'd have to check, whereas anyone 
would immediately know that (1 << 7) is the 7th bit set. Hence, 
readability is worse, and that's important.

-- 
Jens Axboe


  reply	other threads:[~2015-05-20 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 19:14 [PATCH] block: Use BIT macro from include/linux/bitops.h Jagan Teki
2015-05-20 18:43 ` Jagan Teki
2015-05-20 19:22 ` Jens Axboe
2015-05-20 19:41   ` Jagan Teki
2015-05-20 19:43     ` Jens Axboe [this message]
2015-05-20 19:50       ` Jagan Teki
2015-05-20 19:52         ` Jens Axboe

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=555CE3C4.7010406@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=jteki@openedev.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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 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.