lkml.org 
[lkml]   [2014]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: clocking-wizard: Contain macro argument in parenthesis
Date
A macro doing some arithmetic to calculate a register offset, did not
contain an argument to the macro in parentheses, potentially leading to
unexpected results when using that macro with arithmetic expressions as
argument.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index b8d89525bffd..7202d8e889aa 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -29,7 +29,7 @@
#define WZRD_NUM_OUTPUTS 7
#define WZRD_ACLK_MAX_FREQ 250000000UL

-#define WZRD_CLK_CFG_REG(n) (0x200 + 4 * n)
+#define WZRD_CLK_CFG_REG(n) (0x200 + 4 * (n))

#define WZRD_CLkOUT0_FRAC_EN BIT(18)
#define WZRD_CLkFBOUT_FRAC_EN BIT(26)
--
2.1.2.1.g5e69ed6


\
 
 \ /
  Last update: 2014-10-20 22:41    [W:0.025 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site