* [PATCH] comedi: drivers: Fix - BIT macro used coding style issue
@ 2015-11-01 9:59 Ranjith
2015-11-01 10:20 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Ranjith @ 2015-11-01 9:59 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, ranjithece24
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue
2015-11-01 9:59 [PATCH] comedi: drivers: Fix - BIT macro used coding style issue Ranjith
@ 2015-11-01 10:20 ` Andy Shevchenko
2015-11-01 18:10 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2015-11-01 10:20 UTC (permalink / raw)
To: Ranjith
Cc: Greg Kroah-Hartman, Ian Abbott, hsweeten, devel,
linux-kernel@vger.kernel.org
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue
2015-11-01 10:20 ` Andy Shevchenko
@ 2015-11-01 18:10 ` Greg Kroah-Hartman
2015-11-01 18:11 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-11-01 18:10 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Ranjith, devel, Ian Abbott, linux-kernel@vger.kernel.org
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] comedi: drivers: Fix - BIT macro used coding style issue
2015-11-01 18:10 ` Greg Kroah-Hartman
@ 2015-11-01 18:11 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-11-01 18:11 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Ranjith, devel, Ian Abbott, linux-kernel@vger.kernel.org
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-01 18:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 9:59 [PATCH] comedi: drivers: Fix - BIT macro used coding style issue Ranjith
2015-11-01 10:20 ` Andy Shevchenko
2015-11-01 18:10 ` Greg Kroah-Hartman
2015-11-01 18:11 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox