소스 검색

staging: lustre: ldlm: simplify rc initialization

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>
Julia Lawall 11 년 전
부모
커밋
31664dc6f8
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      drivers/staging/lustre/lustre/ldlm/ldlm_request.c

+ 2 - 1
drivers/staging/lustre/lustre/ldlm/ldlm_request.c

@@ -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;
 	}