staging: sm750fb: compress return logic
authorElizabeth Ferdman <gnudevliz@gmail.com>
Wed, 12 Oct 2016 02:29:20 +0000 (19:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 08:26:19 +0000 (10:26 +0200)
Using Coccinelle script, compress return logic to return a value
directly rather than doing an assignment and returning the variable.
Remove unnecessary variable declaration by hand.

Coccinelle script:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/sm750.c

index 8770a46c3c6778d3fcb9357d86fd4c0a6a1202b2..b094492cc5f06b22cb3c0dd2d18faf765e545d02 100644 (file)
@@ -1209,7 +1209,6 @@ static struct pci_driver lynxfb_driver = {
 static int __init lynxfb_init(void)
 {
        char *option;
-       int ret;
 
 #ifdef MODULE
        option = g_option;
@@ -1219,8 +1218,7 @@ static int __init lynxfb_init(void)
 #endif
 
        lynxfb_setup(option);
-       ret = pci_register_driver(&lynxfb_driver);
-       return ret;
+       return pci_register_driver(&lynxfb_driver);
 }
 module_init(lynxfb_init);