diff mbox series

hwrng: core - remove redundant initialization of variable err

Message ID 1621497371-14746-1-git-send-email-zhangshaokun@hisilicon.com
State Accepted
Commit cb028f1662a9910d4b8e3fbe9eb38f7a545540a3
Headers show
Series hwrng: core - remove redundant initialization of variable err | expand

Commit Message

Shaokun Zhang May 20, 2021, 7:56 a.m. UTC
'err' will be assigned later and cleanup the redundant initialization.

Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 drivers/char/hw_random/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu May 28, 2021, 7:25 a.m. UTC | #1
On Thu, May 20, 2021 at 03:56:11PM +0800, Shaokun Zhang wrote:
> 'err' will be assigned later and cleanup the redundant initialization.

> 

> Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>

> Cc: Herbert Xu <herbert@gondor.apana.org.au>

> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>

> ---

>  drivers/char/hw_random/core.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index adb3c2bd7783..322e3d0ea98c 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -323,7 +323,7 @@  static ssize_t hwrng_attr_current_store(struct device *dev,
 					struct device_attribute *attr,
 					const char *buf, size_t len)
 {
-	int err = -ENODEV;
+	int err;
 	struct hwrng *rng, *old_rng, *new_rng;
 
 	err = mutex_lock_interruptible(&rng_mutex);