drivers/base/cpu: remove redundant initialization of variable retval
Subsystems (2)
PATCH 1/1 drivers/base/cpu: remove redundant initialization of variable retval
From: Colin Ian King <[email protected]>
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 <[email protected]>
--- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/cpu.c +1 -1
@@ -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) {
Signature · 1 line
2.30.0
Rafael J. Wysocki
maintainerQuoted 18 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>--- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/cpu.c +0
-0
drivers/base/cpu.c __cpu_device_create(struct device *parent, void *drvdata, · line 412
Quoted 4 lines
drivers/base/cpu.c +0
-1@@ -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 ;
Might as well init it to -ENOMEM and drop the assignment below.
Quoted 5 lines
drivers/base/cpu.c +1
-1+int retval; dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev) { --