staging: lustre: ldlm: simplify rc initialization
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 1 Sep 2014 20:21:10 +0000 (22:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Sep 2014 17:32:58 +0000 (10:32 -0700)
Simplify initialization of rc to take advantage of the fact that it is done
at statement level.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_request.c

index 655a1c7687708f400feda8aaedf7afe173159940..9ce437b1879353da7e8962db1575d67c2ba05ccb 100644 (file)
@@ -569,7 +569,8 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
                if (lvb_len != 0)
                        rc = ldlm_fill_lvb(lock, &req->rq_pill, RCL_SERVER,
                                           lvb, size);
-               rc = (rc != 0 ? rc : ELDLM_LOCK_ABORTED);
+               if (rc == 0)
+                       rc = ELDLM_LOCK_ABORTED;
                goto cleanup;
        }