The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: devel@driverdev.osuosl.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] staging: comedi: comedi.h: Do not use BIT macro
Date: Wed,  2 Mar 2016 14:27:37 +0000	[thread overview]
Message-ID: <1456928858-6014-2-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <1456928858-6014-1-git-send-email-abbotti@mev.co.uk>

The "comedi.h" file is part of the user API for COMEDI devices, and is
intended to be migrated to "include/uapi/linux".  The `BIT` macro from
"include/linux/bitops.h" should not be used there.

Replace the use of the `BIT` macro with hexadecimal constants of the
same value.  The `BIT` macro replaced expressions of the form `(1 << N)`
in this file originally, but reverting back to that form would encourage
patches changing them back to use the `BIT` macro.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index f1415cb..9547324 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -72,12 +72,12 @@
 #define CR_AREF(a)	(((a) >> 24) & 0x03)
 
 #define CR_FLAGS_MASK	0xfc000000
-#define CR_ALT_FILTER	BIT(26)
+#define CR_ALT_FILTER	0x04000000
 #define CR_DITHER	CR_ALT_FILTER
 #define CR_DEGLITCH	CR_ALT_FILTER
-#define CR_ALT_SOURCE	BIT(27)
-#define CR_EDGE		BIT(30)
-#define CR_INVERT	BIT(31)
+#define CR_ALT_SOURCE	0x08000000
+#define CR_EDGE		0x40000000
+#define CR_INVERT	0x80000000
 
 #define AREF_GROUND	0x00	/* analog ref = analog ground */
 #define AREF_COMMON	0x01	/* analog ref = analog common */
@@ -894,7 +894,7 @@ struct comedi_bufinfo {
 #define RANGE_LENGTH(b)		((b) & 0xffff)
 
 #define RF_UNIT(flags)		((flags) & 0xff)
-#define RF_EXTERNAL		BIT(8)
+#define RF_EXTERNAL		0x100
 
 #define UNIT_volt		0
 #define UNIT_mA			1
-- 
2.7.0

  reply	other threads:[~2016-03-02 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 14:27 [PATCH 0/2] staging: comedi: comedi.h: Avoid BIT macro Ian Abbott
2016-03-02 14:27 ` Ian Abbott [this message]
2016-03-02 14:27 ` [PATCH 2/2] staging: comedi: comedi.h: Fix comment for struct comedi_krange Ian Abbott
2016-03-02 16:21 ` [PATCH 0/2] staging: comedi: comedi.h: Avoid BIT macro 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=1456928858-6014-2-git-send-email-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.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