Skip to contentSkip to conversation

staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)

PATCH In review Nandha Kumar Singaram 2 participants 5 messages Oct 16, 2023 – Oct 17, 2023 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)

Adhere to linux coding style. Reported by checkpatch.pl:
CHECK: Prefer using the BIT macro

---
 drivers/staging/rts5208/rtsx_card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_card.h +2 -2
index 39727371cd7a..9d2504fddb13 100644
@@ -338,7 +338,7 @@
 #define DMA_DIR_FROM_CARD		0x02
 #define DMA_EN				0x01
 #define DMA_128				(0 << 4)
-#define DMA_256				(1 << 4)
+#define DMA_256				BIT(4)
 #define DMA_512				(2 << 4)
 #define DMA_1024			(3 << 4)
 #define DMA_PACK_SIZE_MASK		0x30
@@ -542,7 +542,7 @@
 
 #define BLINK_EN			0x08
 #define LED_GPIO0			(0 << 4)
-#define LED_GPIO1			(1 << 4)
+#define LED_GPIO1			BIT(4)
 #define LED_GPIO2			(2 << 4)
 
 #define SDIO_BUS_CTRL		0x01
Signature · 1 line
2.25.1
#1 lore raw
Quoted 13 lines · Nandha Kumar Singaram

Adhere to linux coding style. Reported by checkpatch.pl:
CHECK: Prefer using the BIT macro

---
 drivers/staging/rts5208/rtsx_card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_card.h +0 -0
index 39727371cd7a..9d2504fddb13 100644

drivers/staging/rts5208/rtsx_card.h line 342

Quoted 6 lines
drivers/staging/rts5208/rtsx_card.h +1 -1
@@ -338,7 +338,7 @@
 #define DMA_DIR_FROM_CARD		0x02
 #define DMA_EN				0x01
 #define DMA_128				(0 << 4)
-#define DMA_256				(1 << 4)
+#define DMA_256				BIT(4)
 #define DMA_512				(2 << 4)

No. :P. Look at the lines around it. Now it's the odd duckling.

drivers/staging/rts5208/rtsx_card.h line 547

Quoted 10 lines
drivers/staging/rts5208/rtsx_card.h +1 -1
 #define DMA_1024			(3 << 4)
 #define DMA_PACK_SIZE_MASK		0x30
@@ -542,7 +542,7 @@
 
 #define BLINK_EN			0x08
 #define LED_GPIO0			(0 << 4)
-#define LED_GPIO1			(1 << 4)
+#define LED_GPIO1			BIT(4)
 #define LED_GPIO2			(2 << 4)
 

Same.

regards,
dan carpenter

#2 lore raw

Btw, eventually if we fix enough checkpatch warnings, then eventually we get to a point where all the remaining warnings are wrong. Like we've fixed everything checkpatch gets correct and only wrong things are left. So just be aware of that, that sometimes everything checkpatch suggests is wrong.

regards,
dan carpenter

#3 lore raw
Quoted 9 lines · Dan Carpenter

Btw, eventually if we fix enough checkpatch warnings, then eventually we get to a point where all the remaining warnings are wrong. Like we've fixed everything checkpatch gets correct and only wrong things are left. So just be aware of that, that sometimes everything checkpatch suggests is wrong.

regards,
dan carpenter

Thanks for the feedback dan.

#4 lore raw
In reply to Dan Carpenter
Quoted 36 lines · Dan Carpenter
Quoted 13 lines · Nandha Kumar Singaram

Adhere to linux coding style. Reported by checkpatch.pl:
CHECK: Prefer using the BIT macro

---
 drivers/staging/rts5208/rtsx_card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_card.h +0 -0
index 39727371cd7a..9d2504fddb13 100644

drivers/staging/rts5208/rtsx_card.h line 342

Quoted 6 lines
drivers/staging/rts5208/rtsx_card.h +1 -1
@@ -338,7 +338,7 @@
 #define DMA_DIR_FROM_CARD		0x02
 #define DMA_EN				0x01
 #define DMA_128				(0 << 4)
-#define DMA_256				(1 << 4)
+#define DMA_256				BIT(4)
 #define DMA_512				(2 << 4)

No. :P. Look at the lines around it. Now it's the odd duckling.

drivers/staging/rts5208/rtsx_card.h line 547

Quoted 10 lines
drivers/staging/rts5208/rtsx_card.h +1 -1
 #define DMA_1024			(3 << 4)
 #define DMA_PACK_SIZE_MASK		0x30
@@ -542,7 +542,7 @@
 
 #define BLINK_EN			0x08
 #define LED_GPIO0			(0 << 4)
-#define LED_GPIO1			(1 << 4)
+#define LED_GPIO1			BIT(4)
 #define LED_GPIO2			(2 << 4)
 

Same.

Quoted 3 lines

regards,
dan carpenter

Yeah, I understand now. Thanks for the review dan.

Regards,
Nandha Kumar Singaram