[PATCH v5 8/8] ARM: imx: switch to GENMASK()

From: Andy Shevchenko
Date: Mon Jul 13 2015 - 10:08:19 EST


Convert the code to use GENMASK() helper instead of div_mask() macro.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/clk/imx/clk-fixup-div.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/imx/clk-fixup-div.c b/drivers/clk/imx/clk-fixup-div.c
index 21db020..cd9a843 100644
--- a/drivers/clk/imx/clk-fixup-div.c
+++ b/drivers/clk/imx/clk-fixup-div.c
@@ -16,7 +16,6 @@
#include "clk.h"

#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
-#define div_mask(d) ((1 << (d->width)) - 1)

/**
* struct clk_fixup_div - imx integer fixup divider clock
@@ -70,13 +69,13 @@ static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
/* Zero based divider */
value = divider - 1;

- if (value > div_mask(div))
- value = div_mask(div);
+ if (value > GENMASK(div->width - 1, 0))
+ value = GENMASK(div->width - 1, 0);

spin_lock_irqsave(div->lock, flags);

val = readl(div->reg);
- val &= ~(div_mask(div) << div->shift);
+ val &= ~(GENMASK(div->width - 1, 0) << div->shift);
val |= value << div->shift;
fixup_div->fixup(&val);
writel(val, div->reg);
--
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/