watchdog: ts72xx_wdt: Kill superfluous variable in remove
PATCH 1/1 watchdog: ts72xx_wdt: Kill superfluous variable in remove
There is no need to store the return value of misc_deregister() in a variable. Instead we can just return the value directly.
--- drivers/watchdog/ts72xx_wdt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/watchdog/ts72xx_wdt.c +1 -5
@@ -428,11 +428,7 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)static int ts72xx_wdt_remove (struct platform_device *pdev) { -int error; - - error =misc_deregister (&ts72xx_wdt_miscdev); - -return error; +return misc_deregister (&ts72xx_wdt_miscdev); }static struct platform_driver ts72xx_wdt_driver = {
Signature · 1 line
2.1.0.rc1
Guenter Roeck
maintainerQuoted 13 lines · Mika Westerberg
There is no need to store the return value of
misc_deregister()in a variable. Instead we can just return the value directly.Signed-off-by Mika Westerberg <[email protected]>--- drivers/watchdog/ts72xx_wdt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/watchdog/ts72xx_wdt.c +0
-0
drivers/watchdog/ts72xx_wdt.c static int ts72xx_wdt_probe(struct platform_device *pdev) · line 431
Quoted 9 lines
drivers/watchdog/ts72xx_wdt.c +1
-5@@ -428,11 +428,7 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)static int ts72xx_wdt_remove (struct platform_device *pdev) { -int error; - - error =misc_deregister (&ts72xx_wdt_miscdev); - -return error; +return misc_deregister (&ts72xx_wdt_miscdev);
Is that worth it, and does it even reduce code size ?
Converting the driver to use the watchdog infrastructure would make much more sense (if someone can test the result).
Guenter
Quoted 15 lines · Guenter Roeck
Quoted 14 lines · Mika Westerberg
There is no need to store the return value of
misc_deregister()in a variable. Instead we can just return the value directly.Signed-off-by Mika Westerberg <[email protected]>--- drivers/watchdog/ts72xx_wdt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/watchdog/ts72xx_wdt.c +0
-0@@ -428,11 +428,7 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)
Quoted 10 lines
drivers/watchdog/ts72xx_wdt.c static int ts72xx_wdt_probe(struct platform_device *pdev) · line 431
Quoted 8 lines
drivers/watchdog/ts72xx_wdt.c +1
-5static int ts72xx_wdt_remove (struct platform_device *pdev) { -int error; - - error =misc_deregister (&ts72xx_wdt_miscdev); - -return error; +return misc_deregister (&ts72xx_wdt_miscdev);Is that worth it, and does it even reduce code size ?
Well, it makes that particular function look better.
Quoted 2 lines
Converting the driver to use the watchdog infrastructure would make much more sense (if someone can test the result).
I agree that converting makes sense, but that is subject of a separate patch.
Quoted 4 lines · Mika Westerberg
There is no need to store the return value of
misc_deregister()in a variable. Instead we can just return the value directly.Signed-off-by Mika Westerberg <[email protected]>