[PATCH] clk: xgene: Add missing parenthesis when clearing divider value

Subsystems: common clk framework, the rest

STALE3802d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2016-03-03 · open the first message on its own page

[PATCH] clk: xgene: Add missing parenthesis when clearing divider value

From: Loc Ho <hidden>
Date: 2016-02-29 21:15:43

In the initial fix for non-zero divider shift value, the parenthesis
was missing after the negate operation. This patch adds the required
parenthesis. Otherwise, lower bits may be cleared unintentionally.

Signed-off-by: Loc Ho <redacted>
Acked-by: Toan Le <redacted>
---
 drivers/clk/clk-xgene.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c
index bd7156b..d73450b 100644
--- a/drivers/clk/clk-xgene.c
+++ b/drivers/clk/clk-xgene.c
@@ -376,8 +376,8 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 		/* Set new divider */
 		data = xgene_clk_read(pclk->param.divider_reg +
 				pclk->param.reg_divider_offset);
-		data &= ~((1 << pclk->param.reg_divider_width) - 1)
-				<< pclk->param.reg_divider_shift;
+		data &= ~(((1 << pclk->param.reg_divider_width) - 1)
+				<< pclk->param.reg_divider_shift);
 		data |= divider;
 		xgene_clk_write(data, pclk->param.divider_reg +
 					pclk->param.reg_divider_offset);
-- 
1.7.1

Re: [PATCH] clk: xgene: Add missing parenthesis when clearing divider value

From: Stephen Boyd <hidden>
Date: 2016-03-03 19:37:34

On 02/29, Loc Ho wrote:
In the initial fix for non-zero divider shift value, the parenthesis
was missing after the negate operation. This patch adds the required
parenthesis. Otherwise, lower bits may be cleared unintentionally.

Signed-off-by: Loc Ho <redacted>
Acked-by: Toan Le <redacted>
---
Applied to clk-next + added a fixes tag.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help