Skip to contentSkip to conversation

staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1.

PATCH In review siddhant gupta(siddhant1223) 2 participants 3 messages Nov 2, 2020 – Nov 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1.

Replace left shifting on 1 by a BIT macro to fix checkpatch warning.

---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt7621-dma/mtk-hsdma.c +1 -1
index 354536783e1c..a9e1a1b14035 100644
@@ -72,7 +72,7 @@
 #define HSDMA_GLO_TX_DMA		BIT(0)
 
 #define HSDMA_BT_SIZE_16BYTES		(0 << HSDMA_GLO_BT_SHIFT)
-#define HSDMA_BT_SIZE_32BYTES		(1 << HSDMA_GLO_BT_SHIFT)
+#define HSDMA_BT_SIZE_32BYTES		BIT(HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_64BYTES		(2 << HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_128BYTES		(3 << HSDMA_GLO_BT_SHIFT)
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 14 lines · On Tue, Nov 03, 2020 at 01:04:02AM +0530, siddhant gupta(siddhant1223) wrote:

Replace left shifting on 1 by a BIT macro to fix checkpatch warning.

---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt7621-dma/mtk-hsdma.c +0 -0
index 354536783e1c..a9e1a1b14035 100644

drivers/staging/mt7621-dma/mtk-hsdma.c line 77

Quoted 7 lines
drivers/staging/mt7621-dma/mtk-hsdma.c +1 -1
@@ -72,7 +72,7 @@
 #define HSDMA_GLO_TX_DMA		BIT(0)
 
 #define HSDMA_BT_SIZE_16BYTES		(0 << HSDMA_GLO_BT_SHIFT)
-#define HSDMA_BT_SIZE_32BYTES		(1 << HSDMA_GLO_BT_SHIFT)
+#define HSDMA_BT_SIZE_32BYTES		BIT(HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_64BYTES		(2 << HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_128BYTES		(3 << HSDMA_GLO_BT_SHIFT)

In looking at the code, does this change really make sense?

(hint, I don't think so...)

#2 lore raw
Quoted 26 lines · Greg KH
Quoted 14 lines · On Tue, Nov 03, 2020 at 01:04:02AM +0530, siddhant gupta(siddhant1223) wrote:

Replace left shifting on 1 by a BIT macro to fix checkpatch warning.

---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt7621-dma/mtk-hsdma.c +0 -0
index 354536783e1c..a9e1a1b14035 100644

drivers/staging/mt7621-dma/mtk-hsdma.c line 77

Quoted 7 lines
drivers/staging/mt7621-dma/mtk-hsdma.c +1 -1
@@ -72,7 +72,7 @@
 #define HSDMA_GLO_TX_DMA             BIT(0)
 
 #define HSDMA_BT_SIZE_16BYTES                (0 << HSDMA_GLO_BT_SHIFT)
-#define HSDMA_BT_SIZE_32BYTES                (1 << HSDMA_GLO_BT_SHIFT)
+#define HSDMA_BT_SIZE_32BYTES                BIT(HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_64BYTES                (2 << HSDMA_GLO_BT_SHIFT)
 #define HSDMA_BT_SIZE_128BYTES               (3 << HSDMA_GLO_BT_SHIFT)

In looking at the code, does this change really make sense?

Quoted 1 line

(hint, I don't think so...)

Following Checkpatch, I thought it might be good to do as checkpatch said, but the code looks better and more readable without the change. This is my first patch and also a
lesson that i should not fix every checkpatch warnings. I'll pick something better next time
Thanks for your comment
.