staging: sm750fb: Prefer using the BIT macro
authorSanjana Sanikommu <sanjana99reddy99@gmail.com>
Mon, 25 Mar 2019 07:44:01 +0000 (13:14 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2019 20:49:12 +0000 (05:49 +0900)
Challenge suggested by coccinelle.

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

@@
constant c;
@@

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

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/ddk750_chip.c

index 93abfa8..cd2ca0d 100644 (file)
@@ -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);
 }
 
 /*