Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589313

[PATCH] clk: meson: fix SET_PARM macro

From Jerome Brunet <jbrunet@baylibre.com>
Newsgroups linux.kernel
Subject [PATCH] clk: meson: fix SET_PARM macro
Date 2017-02-28 10:40 +0100
Message-ID <tfMqe-2wl-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] clk: meson: fix SET_PARM macro Jerome Brunet <jbrunet@baylibre.com> - 2017-02-28 10:40 +0100
  Re: [PATCH] clk: meson: fix SET_PARM macro Kevin Hilman <khilman@baylibre.com> - 2017-02-28 19:20 +0100
  Re: [PATCH] clk: meson: fix SET_PARM macro Stephen Boyd <sboyd@codeaurora.org> - 2017-02-28 22:40 +0100
    Re: [PATCH] clk: meson: fix SET_PARM macro Jerome Brunet <jbrunet@baylibre.com> - 2017-02-28 22:50 +0100

csiph-web