diff options
| author | Riccardo Lucchese <riccardo.lucchese@gmail.com> | 2014-07-21 14:15:55 +0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-21 23:29:10 +0400 |
| commit | bd9cb12febe86124998314c4c2f08a0e6e1f80c3 (patch) | |
| tree | d1fc6c15bb1c4e39c7c09a66358d94255e9d99ba | |
| parent | f0ca3e87cc132b67c40ba1161cd02c8a2985ac4c (diff) | |
| download | linux-bd9cb12febe86124998314c4c2f08a0e6e1f80c3.tar.xz | |
staging: lustre: lov: Cleanup lov_check_set() in lov_request.c
Make the code clearer by introducing a local variable and removing the
unnecessary 'if' statement.
Signed-off-by: Riccardo Lucchese <riccardo.lucchese@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_request.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index ce830e45948d..da424de5e8e0 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -140,14 +140,14 @@ void lov_set_add_req(struct lov_request *req, struct lov_request_set *set) static int lov_check_set(struct lov_obd *lov, int idx) { - int rc = 0; + int rc; + struct lov_tgt_desc *tgt; mutex_lock(&lov->lov_lock); - if (lov->lov_tgts[idx] == NULL || - lov->lov_tgts[idx]->ltd_active || - (lov->lov_tgts[idx]->ltd_exp != NULL && - class_exp2cliimp(lov->lov_tgts[idx]->ltd_exp)->imp_connect_tried)) - rc = 1; + tgt = lov->lov_tgts[idx]; + rc = !tgt || tgt->ltd_active || + (tgt->ltd_exp && + class_exp2cliimp(tgt->ltd_exp)->imp_connect_tried); mutex_unlock(&lov->lov_lock); return rc; |
