From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: Ranjith Thangavel <ranjithece24@gmail.com>,
gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro
Date: Thu, 19 Nov 2015 10:51:32 +0300 [thread overview]
Message-ID: <20151119075132.GT18797@mwanda> (raw)
In-Reply-To: <564CA6CC.6010600@mev.co.uk>
On Wed, Nov 18, 2015 at 04:26:52PM +0000, Ian Abbott wrote:
> >+#define DMM32AT_AI_CFG_SCINT_10US (BIT(5) & ~BIT(4))
> >+#define DMM32AT_AI_CFG_SCINT_5US (BIT(5) | BIT(4))
>
> The values of DMM32AT_AI_CFG_SCINT_20US etc. are numerically
> correct, but look a bit strange. The `(BIT(5) & ~BIT(4))` looks
> especially strange and could be changed to `BIT(5)`. These are all
> really shifted 2-bit values, so perhaps the BIT() macro isn't the
> best representation.
>
BIT(5) & ~BIT(4) is silly. Don't do that.
The original code was fine.
regards,
dan carpenter
next prev parent reply other threads:[~2015-11-19 7:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-14 17:10 [PATCH] comedi: dmm32at: Fix coding style - use BIT macro Ranjith Thangavel
2015-11-16 14:43 ` Dan Carpenter
2015-11-18 16:26 ` Ian Abbott
2015-11-18 16:34 ` Ian Abbott
2015-11-19 7:51 ` Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-11-16 17:09 Ranjith Thangavel
2015-11-16 17:21 ` Hartley Sweeten
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=20151119075132.GT18797@mwanda \
--to=dan.carpenter@oracle.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ranjithece24@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 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.