Skip to contentSkip to conversation

staging: sm750fb: Prefer using the BIT macro

PATCH New Sanjana Sanikommu 1 participant 1 message Mar 25, 2019

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

PATCH v3 1/1 staging: sm750fb: Prefer using the BIT macro

Challenge suggested by coccinelle.

Replace bit shifting on 1 with the BIT(x) macro.
Coccinelle script:

@@
constant c;
@@

-(1 << c)
+BIT(c)

---
Changes in v3:
Change the subject line.

Changes in v2:
Modify script to remove parentheses around BIT.

 drivers/staging/sm750fb/ddk750_chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/ddk750_chip.c +1 -1
index 4c1f00f551da..eea4c08b8a26 100644
@@ -45,7 +45,7 @@ static unsigned int get_mxclk_freq(void)
 	OD = (pll_reg & PLL_CTRL_OD_MASK) >> PLL_CTRL_OD_SHIFT;
 	POD = (pll_reg & PLL_CTRL_POD_MASK) >> PLL_CTRL_POD_SHIFT;
 
-	return DEFAULT_INPUT_CLOCK * M / N / (1 << OD) / (1 << POD);
+	return DEFAULT_INPUT_CLOCK * M / N / BIT(OD) / BIT(POD);
 }
 
 /*
Signature · 1 line
2.17.1