Skip to contentSkip to conversation

[PATCH 0/3]

PATCH New Melike Yurtoglu 1 participant 4 messages Feb 27, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover [PATCH 0/3]

This patchset removing return and else,
adds a blank line after declarations to improve code readability.

Melike Yurtoglu (3):
Staging: lustre: Remove return in void function
Staging: lustre: Remove unnecessary else after return
Staging: lustre: Deleted space prohibited between function name and
open parenthesis

 drivers/staging/lustre/lustre/ptlrpc/client.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/3 Staging: lustre: Remove return in void function

WARNING: void function return statements are not generally useful Remove return in void function. That was found by running checkpatch.

---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +0 -1
index 4882dd0..0f83492 100644
@@ -468,7 +468,6 @@ void ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq)
 		list_add_tail(&req->rq_list, &pool->prp_req_list);
 	}
 	spin_unlock(&pool->prp_lock);
-	return;
 }
 EXPORT_SYMBOL(ptlrpc_add_rqs_to_pool);
 
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/3 Staging: lustre: Remove unnecessary else after return

In reply to Melike Yurtoglu

WARNING: else is not generally useful after a break or return Remove unnecessary else after return. That was found by running checkpatch

---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +4 -5
index 0f83492..2ccb72a 100644
@@ -1438,12 +1438,11 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
 		if (req->rq_err) {
 			req->rq_status = rc;
 			return 1;
-		} else {
-			spin_lock(&req->rq_lock);
-			req->rq_wait_ctx = 1;
-			spin_unlock(&req->rq_lock);
-			return 0;
 		}
+		spin_lock(&req->rq_lock);
+		req->rq_wait_ctx = 1;
+		spin_unlock(&req->rq_lock);
+		return 0;
 	}
 
 	CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:nid:opc %s:%s:%d:%llu:%s:%d\n",
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/3 Staging: lustre: Deleted space prohibited between function name and open parenthesis

In reply to Melike Yurtoglu

WARNING: space prohibited between function name and open parenthesis '(' Remove unnecessary space between function name and opening parenthesis. That was found by running checkpatch

---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +1 -1
index 2ccb72a..0fe6a64 100644
@@ -2190,7 +2190,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set)
 	if (set->set_interpret != NULL) {
 		int (*interpreter)(struct ptlrpc_request_set *set, void *, int) =
 			set->set_interpret;
-		rc = interpreter (set, set->set_arg, rc);
+		rc = interpreter(set, set->set_arg, rc);
 	} else {
 		struct ptlrpc_set_cbdata *cbdata, *n;
 		int err;
Signature · 1 line
1.8.3.2