From: Michal Simek Date: Wed, 27 Jun 2018 08:53:18 +0200 Subject: [U-Boot] [UBOOT PATCH] clk: zynqmp: Fixed the same if/else part error reported by coverity In-Reply-To: <1530076485-24872-1-git-send-email-vipul.kumar@xilinx.com> References: <1530076485-24872-1-git-send-email-vipul.kumar@xilinx.com> Message-ID: <7a48cbd9-e5cd-f102-812a-4b98b4fccc5b@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 27.6.2018 07:14, Vipul Kumar wrote: > This patch fixed the same if/else part error by adding the required > source select on the basis of is_pre_src check. > > Signed-off-by: Vipul Kumar > --- > drivers/clk/clk_zynqmp.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/clk_zynqmp.c b/drivers/clk/clk_zynqmp.c > index a9e4500..167f3f7 100644 > --- a/drivers/clk/clk_zynqmp.c > +++ b/drivers/clk/clk_zynqmp.c > @@ -103,6 +103,8 @@ static const resource_size_t zynqmp_crl_apb_clkc_base = 0xff5e0020; > #define PLLCTRL_BYPASS_SHFT 3 > #define PLLCTRL_POST_SRC_SHFT 24 > #define PLLCTRL_POST_SRC_MASK (0x7 << PLLCTRL_POST_SRC_SHFT) > +#define PLLCTRL_PRE_SRC_SHFT 20 > +#define PLLCTRL_PRE_SRC_MASK (0x7 << PLLCTRL_PRE_SRC_SHFT) > > > #define NUM_MIO_PINS 77 > @@ -310,8 +312,8 @@ static ulong zynqmp_clk_get_pll_src(ulong clk_ctrl, > u32 src_sel; > > if (is_pre_src) > - src_sel = (clk_ctrl & PLLCTRL_POST_SRC_MASK) >> > - PLLCTRL_POST_SRC_SHFT; > + src_sel = (clk_ctrl & PLLCTRL_PRE_SRC_MASK) >> > + PLLCTRL_PRE_SRC_SHFT; > else > src_sel = (clk_ctrl & PLLCTRL_POST_SRC_MASK) >> > PLLCTRL_POST_SRC_SHFT; > Applied. Thanks, Michal