lkml.org 
[lkml]   [2021]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers/base/cpu: remove redundant initialization of variable retval
Date
From: Colin Ian King <colin.king@canonical.com>

The variable retval is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/base/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 8f1d6569564c..2e834cd315d8 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -409,7 +409,7 @@ __cpu_device_create(struct device *parent, void *drvdata,
const char *fmt, va_list args)
{
struct device *dev = NULL;
- int retval = -ENODEV;
+ int retval;

dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
--
2.30.0
\
 
 \ /
  Last update: 2021-02-17 20:54    [W:0.034 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site