All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: meson: fix SET_PARM macro
@ 2017-02-28  9:30 ` Jerome Brunet
  0 siblings, 0 replies; 10+ messages in thread
From: Jerome Brunet @ 2017-02-28  9:30 UTC (permalink / raw)
  To: linus-amlogic

parameter val is not enclosed in parenthesis which is buggy when given an
expression instead of a simple value

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/meson/clkc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h
index 9bb70e7a7d6a..c6be77dd8694 100644
--- a/drivers/clk/meson/clkc.h
+++ b/drivers/clk/meson/clkc.h
@@ -25,7 +25,7 @@
 #define PARM_GET(width, shift, reg)					\
 	(((reg) & SETPMASK(width, shift)) >> (shift))
 #define PARM_SET(width, shift, reg, val)				\
-	(((reg) & CLRPMASK(width, shift)) | (val << (shift)))
+	(((reg) & CLRPMASK(width, shift)) | ((val) << (shift)))
 
 #define MESON_PARM_APPLICABLE(p)		(!!((p)->width))
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-01 19:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28  9:30 [PATCH] clk: meson: fix SET_PARM macro Jerome Brunet
2017-02-28  9:30 ` Jerome Brunet
2017-02-28 18:04 ` Kevin Hilman
2017-02-28 18:04   ` Kevin Hilman
2017-02-28 21:26 ` Stephen Boyd
2017-02-28 21:26   ` Stephen Boyd
2017-02-28 21:41   ` Jerome Brunet
2017-02-28 21:41     ` Jerome Brunet
2017-03-01 19:03     ` Stephen Boyd
2017-03-01 19:03       ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.