Skip to contentSkip to conversation

staging: sm750fb: compress return logic

PATCH New Elizabeth Ferdman 1 participant 1 message Oct 12, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: compress return logic

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;

---
 drivers/staging/sm750fb/sm750.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/sm750fb/sm750.c +1 -3
index 8770a46..b094492 100644
@@ -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);
 
Signature · 1 line
2.1.4