Skip to contentSkip to conversation

watchdog: diag288_wdt: Remove redundant assignment

PATCH In review angkery 2 participants 2 messages Feb 3, 2021

Subsystems (2)
lore
Share & tools
lore

angkery

author
#0 lore raw

PATCH 1/1 watchdog: diag288_wdt: Remove redundant assignment

From: Junlin Yang <[email protected]>

The assign for 'ret' is redundant and can be removed, because it will be assigned before use.

---
 drivers/watchdog/diag288_wdt.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/watchdog/diag288_wdt.c +0 -4
index aafc8d9..4cb1087 100644
@@ -118,8 +118,6 @@ static int wdt_start(struct watchdog_device *dev)
 	if (test_and_set_bit(DIAG_WDOG_BUSY, &wdt_status))
 		return -EBUSY;
 
-	ret = -ENODEV;
-
 	if (MACHINE_IS_VM) {
 		ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL);
 		if (!ebc_cmd) {
@@ -167,8 +165,6 @@ static int wdt_ping(struct watchdog_device *dev)
 	int ret;
 	unsigned int func;
 
-	ret = -ENODEV;
-
 	if (MACHINE_IS_VM) {
 		ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL);
 		if (!ebc_cmd)
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · angkery

From: Junlin Yang <[email protected]>

The assign for 'ret' is redundant and can be removed, because it will be assigned before use.

Quoted 27 lines
---
 drivers/watchdog/diag288_wdt.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/watchdog/diag288_wdt.c +0 -4
index aafc8d9..4cb1087 100644
@@ -118,8 +118,6 @@ static int wdt_start(struct watchdog_device *dev)
 	if (test_and_set_bit(DIAG_WDOG_BUSY, &wdt_status))
 		return -EBUSY;
 
-	ret = -ENODEV;
-
 	if (MACHINE_IS_VM) {
 		ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL);
 		if (!ebc_cmd) {
@@ -167,8 +165,6 @@ static int wdt_ping(struct watchdog_device *dev)
 	int ret;
 	unsigned int func;
 
-	ret = -ENODEV;
-
 	if (MACHINE_IS_VM) {
 		ebc_cmd = kmalloc(MAX_CMDLEN, GFP_KERNEL);
 		if (!ebc_cmd)