提交 3dfe7557 编写于 作者: V Vaishali Thakkar 提交者: Greg Kroah-Hartman

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: NVaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: NJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 10352c2a
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册