Skip to contentSkip to conversation

staging: fbtft: Replace bit shifting with BIT macro

PATCH New Payal Kshirsagar 1 participant 3 messages Apr 2, 2019

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

cover staging: fbtft: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

Payal Kshirsagar (2):
staging: fbtft: fb_agm1264k-fl.c: Replace bit shifting with BIT macro
staging: fbtft: fb_ssd1351.c: Replace bit shifting with BIT macro

 drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
 drivers/staging/fbtft/fb_ssd1351.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 staging: fbtft: fb_agm1264k-fl.c: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_agm1264k-fl.c +1 -1
index 8f27bd8..5a513792 100644
@@ -383,7 +383,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 			/* select right side (sc1)
 			 * set addr
 			 */
-			write_reg(par, 0x01, 1 << 6);
+			write_reg(par, 0x01, BIT(6));
 			write_reg(par, 0x01, (0x17 << 3) | (u8)y);
 
 			/* write bitmap */
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 staging: fbtft: fb_ssd1351.c: Replace bit shifting with BIT macro

In reply to Payal Kshirsagar

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

---
 drivers/staging/fbtft/fb_ssd1351.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fb_ssd1351.c +2 -2
index 9ac78ce..900b28d 100644
@@ -81,10 +81,10 @@ static int set_var(struct fbtft_par *par)
 
 	switch (par->info->var.rotate) {
 	case 0:
-		write_reg(par, 0xA0, remap | 0x00 | 1 << 4);
+		write_reg(par, 0xA0, remap | 0x00 | BIT(4));
 		break;
 	case 270:
-		write_reg(par, 0xA0, remap | 0x03 | 1 << 4);
+		write_reg(par, 0xA0, remap | 0x03 | BIT(4));
 		break;
 	case 180:
 		write_reg(par, 0xA0, remap | 0x02);
Signature · 1 line
2.7.4