diff options
author | Marek Vasut <marex@denx.de> | 2024-04-19 08:01:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-30 10:49:01 +0300 |
commit | 5cbe89af7f75280bcaca7f337fbf342b3de1bde5 (patch) | |
tree | cacb839e5d92e3b524922abd908621ef8ac84d3f /drivers/char | |
parent | e57ed345e2e6043629fc74aa5be051415dcc4f77 (diff) | |
download | linux-5cbe89af7f75280bcaca7f337fbf342b3de1bde5.tar.xz |
hwrng: stm32 - use logical OR in conditional
[ Upstream commit 31b57788a5024d3a114b28dad224a93831b90b5f ]
The conditional is used to check whether err is non-zero OR whether
reg variable is non-zero after clearing bits from it. This should be
done using logical OR, not bitwise OR, fix it.
Fixes: 6b85a7e141cb ("hwrng: stm32 - implement STM32MP13x support")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/stm32-rng.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 379bc245c520..1cc61ef8ee54 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -353,7 +353,7 @@ static int stm32_rng_init(struct hwrng *rng) err = readl_relaxed_poll_timeout_atomic(priv->base + RNG_SR, reg, reg & RNG_SR_DRDY, 10, 100000); - if (err | (reg & ~RNG_SR_DRDY)) { + if (err || (reg & ~RNG_SR_DRDY)) { clk_disable_unprepare(priv->clk); dev_err((struct device *)priv->rng.priv, "%s: timeout:%x SR: %x!\n", __func__, err, reg); |