Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1260107 > unrolled thread
| Started by | Ranjith <ranjithece24@gmail.com> |
|---|---|
| First post | 2015-11-01 11:00 +0100 |
| Last post | 2015-11-01 19:20 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] comedi: drivers: Fix - BIT macro used coding style issue Ranjith <ranjithece24@gmail.com> - 2015-11-01 11:00 +0100
Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-01 11:30 +0100
Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-11-01 19:20 +0100
Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-11-01 19:20 +0100
| From | Ranjith <ranjithece24@gmail.com> |
|---|---|
| Date | 2015-11-01 11:00 +0100 |
| Subject | [PATCH] comedi: drivers: Fix - BIT macro used coding style issue |
| Message-ID | <qpXAC-6zD-11@gated-at.bofh.it> |
BIT macro is used for defining bit location instead of shifting
operator - coding style issue
Signed-off-by: Ranjith T <ranjithece24@gmail.com>
---
drivers/staging/comedi/drivers/addi_apci_1032.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index b37166d..fd5ce21 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -85,8 +85,8 @@
#define APCI1032_STATUS_REG 0x0c
#define APCI1032_CTRL_REG 0x10
#define APCI1032_CTRL_INT_OR (0 << 1)
-#define APCI1032_CTRL_INT_AND (1 << 1)
-#define APCI1032_CTRL_INT_ENA (1 << 2)
+#define APCI1032_CTRL_INT_AND BIT(1)
+#define APCI1032_CTRL_INT_ENA BIT(2)
struct apci1032_private {
unsigned long amcc_iobase; /* base of AMCC I/O registers */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2015-11-01 11:30 +0100 |
| Message-ID | <qpY3D-6YY-7@gated-at.bofh.it> |
| In reply to | #1260107 |
On Sun, Nov 1, 2015 at 11:59 AM, Ranjith <ranjithece24@gmail.com> wrote: > BIT macro is used for defining bit location instead of shifting > operator - coding style issue > #define APCI1032_CTRL_INT_OR (0 << 1) > +#define APCI1032_CTRL_INT_AND BIT(1) And now you have two styles at the same time. I wouldn't change the current definitions. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-11-01 19:20 +0100 |
| Message-ID | <qq5ou-3jb-1@gated-at.bofh.it> |
| In reply to | #1260109 |
On Sun, Nov 01, 2015 at 12:20:59PM +0200, Andy Shevchenko wrote: > On Sun, Nov 1, 2015 at 11:59 AM, Ranjith <ranjithece24@gmail.com> wrote: > > BIT macro is used for defining bit location instead of shifting > > operator - coding style issue > > > #define APCI1032_CTRL_INT_OR (0 << 1) > > > +#define APCI1032_CTRL_INT_AND BIT(1) > > And now you have two styles at the same time. I wouldn't change the > current definitions. Yes you should, just use BIT(0) for this one. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-11-01 19:20 +0100 |
| Message-ID | <qq5ou-3jb-7@gated-at.bofh.it> |
| In reply to | #1260214 |
On Sun, Nov 01, 2015 at 10:10:59AM -0800, Greg Kroah-Hartman wrote: > On Sun, Nov 01, 2015 at 12:20:59PM +0200, Andy Shevchenko wrote: > > On Sun, Nov 1, 2015 at 11:59 AM, Ranjith <ranjithece24@gmail.com> wrote: > > > BIT macro is used for defining bit location instead of shifting > > > operator - coding style issue > > > > > #define APCI1032_CTRL_INT_OR (0 << 1) > > > > > +#define APCI1032_CTRL_INT_AND BIT(1) > > > > And now you have two styles at the same time. I wouldn't change the > > current definitions. > > Yes you should, just use BIT(0) for this one. Oh wait, nevermind, just use the "real" value instead, but using the BIT() macro is the correct thing, don't tell people not to use it. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web