* [PATCH v2] staging: lustre: Remove unnecessary return capture
@ 2016-09-15 19:22 Rehas Sachdeva
2016-09-15 19:35 ` Rehas Sachdeva
0 siblings, 1 reply; 2+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 19:22 UTC (permalink / raw)
To: outreachy-kernel
Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
Instead of storing the return value of a function call into a variable and
then returning it, we can club the two into a single return statement. This
change was made using the following semantic patch by Coccinelle:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 5bf95f9..cf94926 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2488,9 +2488,8 @@ static int mdc_set_info_async(const struct lu_env *env,
}
spin_unlock(&imp->imp_lock);
- rc = do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
- keylen, key, vallen, val, set);
- return rc;
+ return do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
+ keylen, key, vallen, val, set);
}
if (KEY_IS(KEY_SPTLRPC_CONF)) {
sptlrpc_conf_client_adapt(exp->exp_obd);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] staging: lustre: Remove unnecessary return capture
2016-09-15 19:22 [PATCH v2] staging: lustre: Remove unnecessary return capture Rehas Sachdeva
@ 2016-09-15 19:35 ` Rehas Sachdeva
0 siblings, 0 replies; 2+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 19:35 UTC (permalink / raw)
To: outreachy-kernel; +Cc: oleg.drokin, andreas.dilger, jsimmons, gregkh
[-- Attachment #1.1: Type: text/plain, Size: 1576 bytes --]
Please ignore this for v2 as i forgot to include the changelog.
On Friday, September 16, 2016 at 12:53:01 AM UTC+5:30, Rehas Sachdeva wrote:
>
> Instead of storing the return value of a function call into a variable and
> then returning it, we can club the two into a single return statement.
> This
> change was made using the following semantic patch by Coccinelle:
>
> @@
> local idexpression ret;
> expression e;
> @@
>
> -ret =
> +return
> e;
> -return ret;
>
> Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
> ---
> drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c
> b/drivers/staging/lustre/lustre/mdc/mdc_request.c
> index 5bf95f9..cf94926 100644
> --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
> +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
> @@ -2488,9 +2488,8 @@ static int mdc_set_info_async(const struct lu_env
> *env,
> }
> spin_unlock(&imp->imp_lock);
>
> - rc = do_set_info_async(imp, MDS_SET_INFO,
> LUSTRE_MDS_VERSION,
> - keylen, key, vallen, val, set);
> - return rc;
> + return do_set_info_async(imp, MDS_SET_INFO,
> LUSTRE_MDS_VERSION,
> + keylen, key, vallen, val, set);
> }
> if (KEY_IS(KEY_SPTLRPC_CONF)) {
> sptlrpc_conf_client_adapt(exp->exp_obd);
> --
> 2.7.4
>
>
[-- Attachment #1.2: Type: text/html, Size: 2272 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-15 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 19:22 [PATCH v2] staging: lustre: Remove unnecessary return capture Rehas Sachdeva
2016-09-15 19:35 ` Rehas Sachdeva
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.