[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180116110454.Horde.huLPzLc04Vxa4i6KvD7bZWl@gator4166.hostgator.com>
Date: Tue, 16 Jan 2018 11:04:54 -0600
From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To: Michal Simek <michal.simek@...inx.com>
Cc: Dhaval Rajeshbhai Shah <dhaval.shah@...inx.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: xilinx: xlnx_vcu: Use bitwise & rather than
logical && on clkoutdiv
Quoting Michal Simek <michal.simek@...inx.com>:
> On 16.1.2018 15:22, Dhaval Rajeshbhai Shah wrote:
>> Hi,
>>
>>> -----Original Message-----
>>> From: Gustavo A. R. Silva [mailto:garsilva@...eddedor.com]
>>> Sent: Monday, January 15, 2018 11:15 AM
>>> To: Michal Simek <michal.simek@...inx.com>; Dhaval Rajeshbhai Shah
>>> <DSHAH@...inx.com>
>>> Cc: linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org;
>>> Gustavo A. R. Silva <garsilva@...eddedor.com>
>>> Subject: [PATCH] soc: xilinx: xlnx_vcu: Use bitwise & rather than
>>> logical && on
>>> clkoutdiv
>>>
>>> Currently clkoutdiv is being operated on by a logical && operator
>>> rather than a
>>> bitwise & operator. This looks incorrect as these should be bit
>>> flag operations.
>>>
>>> Addresses-Coverity-ID: 1463959 ("Logical vs. bitwise operator")
>>> Fixes: cee8113a295a ("soc: xilinx: xlnx_vcu: Add Xilinx ZYNQMP VCU
>>> logicoreIP
>>> init driver")
>>> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
>>> ---
>>> drivers/soc/xilinx/xlnx_vcu.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/soc/xilinx/xlnx_vcu.c
>>> b/drivers/soc/xilinx/xlnx_vcu.c index
>>> c1d6f1b..a840c02 100644
>>> --- a/drivers/soc/xilinx/xlnx_vcu.c
>>> +++ b/drivers/soc/xilinx/xlnx_vcu.c
>>> @@ -334,7 +334,7 @@ static int xvcu_set_vcu_pll_info(struct xvcu_device
>>> *xvcu)
>>> */
>>> vcu_pll_ctrl = xvcu_read(xvcu->vcu_slcr_ba, VCU_PLL_CTRL);
>>> clkoutdiv = vcu_pll_ctrl >> VCU_PLL_CTRL_CLKOUTDIV_SHIFT;
>>> -clkoutdiv = clkoutdiv && VCU_PLL_CTRL_CLKOUTDIV_MASK;
>>> +clkoutdiv = clkoutdiv & VCU_PLL_CTRL_CLKOUTDIV_MASK;
>>> if (clkoutdiv != 1) {
>>> dev_err(xvcu->dev, "clkoutdiv value is invalid\n");
>>> return -EINVAL;
>>> --
>>> 2.7.4
>>
>> Acked-by: Dhaval Shah <dshah@...inx.com>
>
> Applied.
>
> Thanks,
> Michal
Thank you guys.
--
Gustavo
Powered by blists - more mailing lists