Skip to contentSkip to conversation

Staging: lustre: mdc_locks: Remove extra test expression

PATCH In review Shivani Bhardwaj 2 participants 2 messages Oct 15, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: mdc_locks: Remove extra test expression

struct it is already NULL tested before so, it should be removed from the if test expression.

---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +1 -1
index e0b81ee..d4bf34b 100644
@@ -885,7 +885,7 @@ resend:
 
 	/* Retry the create infinitely when we get -EINPROGRESS from
 	 * server. This is required by the new quota design. */
-	if (it && it->it_op & IT_CREAT &&
+	if (it->it_op & IT_CREAT &&
 	    (int)lockrep->lock_policy_res2 == -EINPROGRESS) {
 		mdc_clear_replay_flag(req, rc);
 		ptlrpc_req_finished(req);
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · On Thursday 15 October 2015 19:46:06 Shivani Bhardwaj wrote:

struct it is already NULL tested before so, it should be removed from the if test expression.

---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +0 -0
index e0b81ee..d4bf34b 100644

drivers/staging/lustre/lustre/mdc/mdc_locks.c resend: · line 891

Quoted 8 lines
drivers/staging/lustre/lustre/mdc/mdc_locks.c +1 -1
@@ -885,7 +885,7 @@ resend:
 
        /* Retry the create infinitely when we get -EINPROGRESS from
         * server. This is required by the new quota design. */
-       if (it && it->it_op & IT_CREAT &&
+       if (it->it_op & IT_CREAT &&
            (int)lockrep->lock_policy_res2 == -EINPROGRESS) {
                mdc_clear_replay_flag(req, rc);
                ptlrpc_req_finished(req);

It took me a while to figure out that this is actually correct, but it is.