linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@dowhile0.org>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 0/4] use BIT() macro instead manually shifting bits
Date: Sun, 27 Apr 2014 12:46:04 +0200	[thread overview]
Message-ID: <CABxcv==uty8xiVp6AF-43dZCrFNY3_0ZenrLb50RML2DMFGEdA@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFu+-XiOGu4Bpm_Naa+GDd4t8xiMwKGQxzpgCKCdmtjOMyA@mail.gmail.com>

Hello Alexandre,

Thanks a lot for your feedback.

On Sun, Apr 27, 2014 at 12:16 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Sun, Apr 27, 2014 at 9:00 AM, Javier Martinez Canillas
> <javier@dowhile0.org> wrote:
>> Hello Linus and Alexandre,
>>
>> While learning coccinelle towards doing the big gpio_chip/gpio_chip_ops
>> split refactoring I wrote this trivial semantic patch that replaces a
>> manual bit shift by using the BIT macro from <linux/bitops.h>
>>
>>     @hasbitops@
>>     @@
>>
>>     #include <linux/bitops.h>
>>
>>     @depends on hasbitops@
>>     expression E;
>>     @@
>>
>>     - 1 << E
>>     + BIT(E)
>>
>>     @depends on hasbitops@
>>     expression E;
>>     @@
>>
>>     - BIT((E))
>>     + BIT(E)
>>
>> When applying to the drivers/gpio subdirectory I got
>> the following clean up patches for some GPIO drivers.
>
> I personally find "1 << n" easier to read than a macro, but you are
> right that the macro is less error-prone. Nice use of Coccinelle btw,
> I should really spend the time to learn it.
>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

Yes I agree that the readability is a matter of personal taste. Do you
want me to send a v2 with a better wording on the commit message?

Best regards,
Javier

  reply	other threads:[~2014-04-27 10:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27  0:00 [PATCH 0/4] use BIT() macro instead manually shifting bits Javier Martinez Canillas
2014-04-27  0:00 ` [PATCH 1/4] gpio: em: " Javier Martinez Canillas
2014-04-27  0:00 ` [PATCH 2/4] gpio: kempld: " Javier Martinez Canillas
2014-04-27  0:00 ` [PATCH 3/4] gpio: omap: " Javier Martinez Canillas
2014-04-27  0:00 ` [PATCH 4/4] gpio: pl061: " Javier Martinez Canillas
2014-04-27 10:16 ` [PATCH 0/4] " Alexandre Courbot
2014-04-27 10:46   ` Javier Martinez Canillas [this message]
2014-04-27 11:16     ` Alexandre Courbot
2014-04-27 11:48       ` Javier Martinez Canillas
2014-05-03 19:15 ` Linus Walleij
2014-05-05 11:02   ` Javier Martinez Canillas

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='CABxcv==uty8xiVp6AF-43dZCrFNY3_0ZenrLb50RML2DMFGEdA@mail.gmail.com' \
    --to=javier@dowhile0.org \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=santosh.shilimkar@ti.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;
as well as URLs for NNTP newsgroup(s).