All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: compress return logic
@ 2016-10-12  2:29 Elizabeth Ferdman
  0 siblings, 0 replies; only message in thread
From: Elizabeth Ferdman @ 2016-10-12  2:29 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: sudipm.mukherjee, teddy.wang, gregkh

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>
---
 drivers/staging/sm750fb/sm750.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8770a46..b094492 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -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);
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-12  2:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12  2:29 [PATCH] staging: sm750fb: compress return logic Elizabeth Ferdman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.