Thread (28 messages) 28 messages, 6 authors, 2015-10-15
STALE3939d

[PATCH] hwrng: fix simple_return.cocci warnings

From: kbuild test robot <hidden>
Date: 2015-10-03 21:05:03
Also in: linux-crypto, linux-devicetree, lkml

drivers/char/hw_random/stm32-rng.c:164:1-4: WARNING: end returns can be simpified

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Daniel Thompson <redacted>
Signed-off-by: Fengguang Wu <redacted>
---

 stm32-rng.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -161,11 +161,7 @@ static int stm32_rng_probe(struct platfo
 	priv->rng.read = stm32_rng_read,
 	priv->rng.priv = (unsigned long) dev;
 
-	err = hwrng_register(&priv->rng);
-	if (err)
-		return err;
-
-	return 0;
+	return hwrng_register(&priv->rng);
 }
 
 static const struct of_device_id stm32_rng_match[] = {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help