Skip to contentSkip to conversation

staging: olpc_dcon: Replace a bit shift by a use of BIT.

PATCH In review Anchal Jain 3 participants 3 messages Sep 18, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: olpc_dcon: Replace a bit shift by a use of BIT.

This patch replaces bit shifting on 1 with the BIT(x) macro as it's extensively used by other function in the file olpc_dcon.h .

---
 drivers/staging/olpc_dcon/olpc_dcon.h | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/olpc_dcon/olpc_dcon.h +15 -15
index 215e7ec..23a48a1 100644
@@ -9,18 +9,18 @@
 #define DCON_REG_ID		 0
 #define DCON_REG_MODE		 1
 
-#define MODE_PASSTHRU	(1<<0)
-#define MODE_SLEEP	(1<<1)
-#define MODE_SLEEP_AUTO	(1<<2)
-#define MODE_BL_ENABLE	(1<<3)
-#define MODE_BLANK	(1<<4)
-#define MODE_CSWIZZLE	(1<<5)
-#define MODE_COL_AA	(1<<6)
-#define MODE_MONO_LUMA	(1<<7)
-#define MODE_SCAN_INT	(1<<8)
-#define MODE_CLOCKDIV	(1<<9)
-#define MODE_DEBUG	(1<<14)
-#define MODE_SELFTEST	(1<<15)
+#define MODE_PASSTHRU	bit(0)
+#define MODE_SLEEP	bit(1)
+#define MODE_SLEEP_AUTO	bit(2)
+#define MODE_BL_ENABLE	bit(3)
+#define MODE_BLANK	bit(4)
+#define MODE_CSWIZZLE	bit(5)
+#define MODE_COL_AA	bit(6)
+#define MODE_MONO_LUMA	bit(7)
+#define MODE_SCAN_INT	bit(8)
+#define MODE_CLOCKDIV	bit(9)
+#define MODE_DEBUG	bit(14)
+#define MODE_SELFTEST	bit(15)
 
 #define DCON_REG_HRES		0x2
 #define DCON_REG_HTOTAL		0x3
@@ -35,11 +35,11 @@
 #define DCON_REG_MEM_OPT_B	0x42
 
 /* Load Delay Locked Loop (DLL) settings for clock delay */
-#define MEM_DLL_CLOCK_DELAY	(1<<0)
+#define MEM_DLL_CLOCK_DELAY	bit(0)
 /* Memory controller power down function */
-#define MEM_POWER_DOWN		(1<<8)
+#define MEM_POWER_DOWN		bit(8)
 /* Memory controller software reset */
-#define MEM_SOFT_RESET		(1<<0)
+#define MEM_SOFT_RESET		bit(0)
 
 /* Status values */
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Anchal Jain

This patch replaces bit shifting on 1 with the BIT(x) macro as it's extensively used by other function in the file olpc_dcon.h .

I think you have already made this mistake before. The macro is BIT, not bit. This is a header file, so you can't compile the file directly, but you should be able to compile some file that includes it.

julia

Quoted 66 lines
---
 drivers/staging/olpc_dcon/olpc_dcon.h | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/olpc_dcon/olpc_dcon.h +15 -16
index 215e7ec..23a48a1 100644
@@ -9,18 +9,18 @@
 #define DCON_REG_ID		 0
 #define DCON_REG_MODE		 1
 
-#define MODE_PASSTHRU	(1<<0)
-#define MODE_SLEEP	(1<<1)
-#define MODE_SLEEP_AUTO	(1<<2)
-#define MODE_BL_ENABLE	(1<<3)
-#define MODE_BLANK	(1<<4)
-#define MODE_CSWIZZLE	(1<<5)
-#define MODE_COL_AA	(1<<6)
-#define MODE_MONO_LUMA	(1<<7)
-#define MODE_SCAN_INT	(1<<8)
-#define MODE_CLOCKDIV	(1<<9)
-#define MODE_DEBUG	(1<<14)
-#define MODE_SELFTEST	(1<<15)
+#define MODE_PASSTHRU	bit(0)
+#define MODE_SLEEP	bit(1)
+#define MODE_SLEEP_AUTO	bit(2)
+#define MODE_BL_ENABLE	bit(3)
+#define MODE_BLANK	bit(4)
+#define MODE_CSWIZZLE	bit(5)
+#define MODE_COL_AA	bit(6)
+#define MODE_MONO_LUMA	bit(7)
+#define MODE_SCAN_INT	bit(8)
+#define MODE_CLOCKDIV	bit(9)
+#define MODE_DEBUG	bit(14)
+#define MODE_SELFTEST	bit(15)
 
 #define DCON_REG_HRES		0x2
 #define DCON_REG_HTOTAL		0x3
@@ -35,11 +35,11 @@
 #define DCON_REG_MEM_OPT_B	0x42
 
 /* Load Delay Locked Loop (DLL) settings for clock delay */
-#define MEM_DLL_CLOCK_DELAY	(1<<0)
+#define MEM_DLL_CLOCK_DELAY	bit(0)
 /* Memory controller power down function */
-#define MEM_POWER_DOWN		(1<<8)
+#define MEM_POWER_DOWN		bit(8)
 /* Memory controller software reset */
-#define MEM_SOFT_RESET		(1<<0)
+#define MEM_SOFT_RESET		bit(0)
 
 /* Status values */
 
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160918064513.GA3810%40life-desktop.
For more options, visit https://groups.google.com/d/optout.

maintainer
#2 lore raw
Quoted 10 lines · Julia Lawall
Quoted 2 lines · Anchal Jain

This patch replaces bit shifting on 1 with the BIT(x) macro as it's extensively used by other function in the file olpc_dcon.h .

I think you have already made this mistake before. The macro is BIT, not bit. This is a header file, so you can't compile the file directly, but you should be able to compile some file that includes it.

Ugh, I missed this one again, now reverted...

greg k-h