[PATCH v4 2/6] clk: mmp: switch to GENMASK()

From: Andy Shevchenko
Date: Thu Jul 09 2015 - 12:44:55 EST


Convert the code to use GENMASK() helper instead of custom approach.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/clk/mmp/clk-mix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c
index de6a873..3aad9c8 100644
--- a/drivers/clk/mmp/clk-mix.c
+++ b/drivers/clk/mmp/clk-mix.c
@@ -26,7 +26,7 @@

static unsigned int _get_maxdiv(struct mmp_clk_mix *mix)
{
- unsigned int div_mask = (1 << mix->reg_info.width_div) - 1;
+ unsigned int div_mask = GENMASK(mix->reg_info.width_div - 1, 0);
unsigned int maxdiv = 0;
struct clk_div_table *clkt;

--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/