Skip to content

Commit 31b5778

Browse files
Marek Vasutherbertx
authored andcommitted
hwrng: stm32 - use logical OR in conditional
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: 6b85a7e ("hwrng: stm32 - implement STM32MP13x support") Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 01474b7 commit 31b5778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/hw_random/stm32-rng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int stm32_rng_init(struct hwrng *rng)
353353
err = readl_relaxed_poll_timeout_atomic(priv->base + RNG_SR, reg,
354354
reg & RNG_SR_DRDY,
355355
10, 100000);
356-
if (err | (reg & ~RNG_SR_DRDY)) {
356+
if (err || (reg & ~RNG_SR_DRDY)) {
357357
clk_disable_unprepare(priv->clk);
358358
dev_err((struct device *)priv->rng.priv,
359359
"%s: timeout:%x SR: %x!\n", __func__, err, reg);

0 commit comments

Comments
 (0)