diff options
author | Vaishali Thakkar <vthakkar1994@gmail.com> | 2014-09-19 10:30:59 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-19 17:25:22 -0700 |
commit | 3dfe7557809e5867306c7a0614b9d1c6036cbe4d (patch) | |
tree | f2d8b8a4fc5e5ec843843ebe307993f0b373eda1 /drivers/staging/dgnc | |
parent | 10352c2a69f4aa2724f007a4922518c9ece7bf89 (diff) | |
download | talos-op-linux-3dfe7557809e5867306c7a0614b9d1c6036cbe4d.tar.gz talos-op-linux-3dfe7557809e5867306c7a0614b9d1c6036cbe4d.zip |
Staging: dgnc: Merge lines and remove unused variable for immediate return
This patch merges two lines in a single line if immediate
return is found. It also removes unnecessory variable rc
as it is no longer needed.
This is done using Coccinelle. Semantic patch used for this
is as follows:
@@
type T;
identifier i;
identifier f;
constant C;
@@
- T i;
...when != i
when strict
(
return -C;
|
- i =
+ return
f(...);
- return i;
)
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r-- | drivers/staging/dgnc/dgnc_tty.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 0e903dc06236..a4e6c9ed799a 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -2286,7 +2286,6 @@ static inline int dgnc_get_mstat(struct channel_t *ch) static int dgnc_get_modem_info(struct channel_t *ch, unsigned int __user *value) { int result; - int rc; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) return -ENXIO; @@ -2296,9 +2295,7 @@ static int dgnc_get_modem_info(struct channel_t *ch, unsigned int __user *value if (result < 0) return -ENXIO; - rc = put_user(result, value); - - return rc; + return put_user(result, value); } |