From: Elizabeth Ferdman <gnudevliz@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
gregkh@linuxfoundation.org
Subject: [PATCH] staging: sm750fb: compress return logic
Date: Tue, 11 Oct 2016 19:29:20 -0700 [thread overview]
Message-ID: <20161012022918.GA14974@localhost> (raw)
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
reply other threads:[~2016-10-12 2:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161012022918.GA14974@localhost \
--to=gnudevliz@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.