* [PATCH 0/2] Remove unnecessary functions and clean up the code @ 2015-10-29 5:31 Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 1/2] Staging: lustre: console: Drop unnecessary wrapper function Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement Shivani Bhardwaj 0 siblings, 2 replies; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 5:31 UTC (permalink / raw) To: outreachy-kernel; +Cc: outreachy-kernel This patchset removes an unnecessary wrapper function and replaces its calls with appropriate function. Also, an unnecessary return statement is removed. After applying this patchset, code becomes cleaner. Shivani Bhardwaj (2): Staging: lustre: console: Drop unnecessary wrapper function Staging: lustre: console: Remove irrelevant return statement drivers/staging/lustre/lnet/selftest/console.c | 80 ++++++++++++-------------- 1 file changed, 36 insertions(+), 44 deletions(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] Staging: lustre: console: Drop unnecessary wrapper function 2015-10-29 5:31 [PATCH 0/2] Remove unnecessary functions and clean up the code Shivani Bhardwaj @ 2015-10-29 5:32 ` Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement Shivani Bhardwaj 1 sibling, 0 replies; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 5:32 UTC (permalink / raw) To: outreachy-kernel; +Cc: outreachy-kernel Remove the function lstcon_group_put() and replace all its calls with the function lstcon_group_decref() because the former function just performs the job of calling the latter. Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> --- drivers/staging/lustre/lnet/selftest/console.c | 78 ++++++++++++-------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index d315dd4..9748a09 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -277,12 +277,6 @@ lstcon_group_find(const char *name, lstcon_group_t **grpp) return -ENOENT; } -static void -lstcon_group_put(lstcon_group_t *grp) -{ - lstcon_group_decref(grp); -} - static int lstcon_group_ndlink_find(lstcon_group_t *grp, lnet_process_id_t id, lstcon_ndlink_t **ndlpp, int create) @@ -436,7 +430,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp, } if (rc != 0) { - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } @@ -445,7 +439,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp, tmp, lstcon_sesrpc_condition, &trans); if (rc != 0) { CERROR("Can't create transaction: %d\n", rc); - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } @@ -460,7 +454,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp, lstcon_rpc_trans_destroy(trans); lstcon_group_move(tmp, grp); - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } @@ -510,12 +504,12 @@ lstcon_group_nodes_remove(lstcon_group_t *grp, lstcon_rpc_trans_destroy(trans); /* release nodes anyway, because we can't rollback status */ - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; error: lstcon_group_move(tmp, grp); - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } @@ -529,7 +523,7 @@ lstcon_group_add(char *name) rc = (lstcon_group_find(name, &grp) == 0) ? -EEXIST : 0; if (rc != 0) { /* find a group with same name */ - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -563,14 +557,14 @@ lstcon_nodes_add(char *name, int count, lnet_process_id_t *ids_up, if (grp->grp_ref > 2) { /* referred by other threads or test */ CDEBUG(D_NET, "Group %s is busy\n", name); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -EBUSY; } rc = lstcon_group_nodes_add(grp, count, ids_up, featp, result_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -591,7 +585,7 @@ lstcon_group_del(char *name) if (grp->grp_ref > 2) { /* referred by others threads or test */ CDEBUG(D_NET, "Group %s is busy\n", name); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -EBUSY; } @@ -600,7 +594,7 @@ lstcon_group_del(char *name) grp, lstcon_sesrpc_condition, &trans); if (rc != 0) { CERROR("Can't create transaction: %d\n", rc); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -608,10 +602,10 @@ lstcon_group_del(char *name) lstcon_rpc_trans_destroy(trans); - lstcon_group_put(grp); + lstcon_group_decref(grp); /* -ref for session, it's destroyed, * status can't be rolled back, destroy group anyway */ - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -631,7 +625,7 @@ lstcon_group_clean(char *name, int args) if (grp->grp_ref > 2) { /* referred by test */ CDEBUG(D_NET, "Group %s is busy\n", name); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -EBUSY; } @@ -640,10 +634,10 @@ lstcon_group_clean(char *name, int args) lstcon_group_drain(grp, args); - lstcon_group_put(grp); + lstcon_group_decref(grp); /* release empty group */ if (list_empty(&grp->grp_ndl_list)) - lstcon_group_put(grp); + lstcon_group_decref(grp); return 0; } @@ -664,16 +658,16 @@ lstcon_nodes_remove(char *name, int count, if (grp->grp_ref > 2) { /* referred by test */ CDEBUG(D_NET, "Group %s is busy\n", name); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -EBUSY; } rc = lstcon_group_nodes_remove(grp, count, ids_up, result_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); /* release empty group */ if (list_empty(&grp->grp_ndl_list)) - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -694,7 +688,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up) if (grp->grp_ref > 2) { /* referred by test */ CDEBUG(D_NET, "Group %s is busy\n", name); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -EBUSY; } @@ -705,7 +699,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up) if (rc != 0) { /* local error, return */ CDEBUG(D_NET, "Can't create transaction: %d\n", rc); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -715,7 +709,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up) lstcon_rpc_trans_destroy(trans); /* -ref for me */ - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -797,7 +791,7 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p, /* verbose query */ rc = lstcon_nodes_getent(&grp->grp_ndl_list, index_p, count_p, dents_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -806,7 +800,7 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p, LIBCFS_ALLOC(gentp, sizeof(lstcon_ndlist_ent_t)); if (gentp == NULL) { CERROR("Can't allocate ndlist_ent\n"); - lstcon_group_put(grp); + lstcon_group_decref(grp); return -ENOMEM; } @@ -819,7 +813,7 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p, LIBCFS_FREE(gentp, sizeof(lstcon_ndlist_ent_t)); - lstcon_group_put(grp); + lstcon_group_decref(grp); return 0; } @@ -1096,8 +1090,8 @@ lstcon_batch_destroy(lstcon_batch_t *bat) list_del(&test->tes_link); - lstcon_group_put(test->tes_src_grp); - lstcon_group_put(test->tes_dst_grp); + lstcon_group_decref(test->tes_src_grp); + lstcon_group_decref(test->tes_dst_grp); LIBCFS_FREE(test, offsetof(lstcon_test_t, tes_param[test->tes_paramlen])); @@ -1352,10 +1346,10 @@ out: LIBCFS_FREE(test, offsetof(lstcon_test_t, tes_param[paramlen])); if (dst_grp != NULL) - lstcon_group_put(dst_grp); + lstcon_group_decref(dst_grp); if (src_grp != NULL) - lstcon_group_put(src_grp); + lstcon_group_decref(src_grp); return rc; } @@ -1518,7 +1512,7 @@ lstcon_group_stat(char *grp_name, int timeout, struct list_head *result_up) rc = lstcon_ndlist_stat(&grp->grp_ndl_list, timeout, result_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -1556,13 +1550,13 @@ lstcon_nodes_stat(int count, lnet_process_id_t *ids_up, } if (rc != 0) { - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } rc = lstcon_ndlist_stat(&tmp->grp_ndl_list, timeout, result_up); - lstcon_group_put(tmp); + lstcon_group_decref(tmp); return rc; } @@ -1629,7 +1623,7 @@ lstcon_group_debug(int timeout, char *name, rc = lstcon_debug_ndlist(&grp->grp_ndl_list, NULL, timeout, result_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -1666,14 +1660,14 @@ lstcon_nodes_debug(int timeout, } if (rc != 0) { - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } rc = lstcon_debug_ndlist(&grp->grp_ndl_list, NULL, timeout, result_up); - lstcon_group_put(grp); + lstcon_group_decref(grp); return rc; } @@ -1847,7 +1841,7 @@ lstcon_session_end(void) lstcon_group_t, grp_link); LASSERT(grp->grp_ref == 1); - lstcon_group_put(grp); + lstcon_group_decref(grp); } /* all nodes should be released */ @@ -1966,7 +1960,7 @@ lstcon_acceptor_handle(srpc_server_rpc_t *rpc) out: rep->msg_ses_feats = console_session.ses_features; if (grp != NULL) - lstcon_group_put(grp); + lstcon_group_decref(grp); mutex_unlock(&console_session.ses_mutex); -- 2.1.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:31 [PATCH 0/2] Remove unnecessary functions and clean up the code Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 1/2] Staging: lustre: console: Drop unnecessary wrapper function Shivani Bhardwaj @ 2015-10-29 5:32 ` Shivani Bhardwaj 2015-10-29 5:48 ` [Outreachy kernel] " Sudip Mukherjee 1 sibling, 1 reply; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 5:32 UTC (permalink / raw) To: outreachy-kernel; +Cc: outreachy-kernel Remove return statement from the function lstcon_group_ndlink_move() as its return type is void. Fix checkpatch WARNING: void function return statements are not generally useful Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> --- drivers/staging/lustre/lnet/selftest/console.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 9748a09..b1eceb4 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -318,8 +318,6 @@ lstcon_group_ndlink_move(lstcon_group_t *old, list_add_tail(&ndl->ndl_hlink, &new->grp_ndl_hash[idx]); list_add_tail(&ndl->ndl_link, &new->grp_ndl_list); new->grp_nnode++; - - return; } static void -- 2.1.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:32 ` [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement Shivani Bhardwaj @ 2015-10-29 5:48 ` Sudip Mukherjee 2015-10-29 5:54 ` Shivani Bhardwaj 0 siblings, 1 reply; 9+ messages in thread From: Sudip Mukherjee @ 2015-10-29 5:48 UTC (permalink / raw) To: Shivani Bhardwaj; +Cc: outreachy-kernel On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: > Remove return statement from the function lstcon_group_ndlink_move() > as its return type is void. > Fix checkpatch WARNING: void function return statements are not > generally useful > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> checkpatch is complaining about the "Signed-off-by" because of an extra space. regards sudip ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:48 ` [Outreachy kernel] " Sudip Mukherjee @ 2015-10-29 5:54 ` Shivani Bhardwaj 2015-10-29 5:57 ` Sudip Mukherjee 0 siblings, 1 reply; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 5:54 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 564 bytes --] On Thu, Oct 29, 2015 at 11:18 AM, Sudip Mukherjee < sudipm.mukherjee@gmail.com> wrote: > On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: > > Remove return statement from the function lstcon_group_ndlink_move() > > as its return type is void. > > Fix checkpatch WARNING: void function return statements are not > > generally useful > > > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> > > checkpatch is complaining about the "Signed-off-by" because of an > extra space. > > regards > sudip > Sending this again. I'm sorry. Thank you [-- Attachment #2: Type: text/html, Size: 1136 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:54 ` Shivani Bhardwaj @ 2015-10-29 5:57 ` Sudip Mukherjee 2015-10-29 5:59 ` Shivani Bhardwaj 0 siblings, 1 reply; 9+ messages in thread From: Sudip Mukherjee @ 2015-10-29 5:57 UTC (permalink / raw) To: Shivani Bhardwaj; +Cc: outreachy-kernel On Thu, Oct 29, 2015 at 11:24:59AM +0530, Shivani Bhardwaj wrote: > On Thu, Oct 29, 2015 at 11:18 AM, Sudip Mukherjee < > sudipm.mukherjee@gmail.com> wrote: > > > On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: > > > Remove return statement from the function lstcon_group_ndlink_move() > > > as its return type is void. > > > Fix checkpatch WARNING: void function return statements are not > > > generally useful > > > > > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> > > > > checkpatch is complaining about the "Signed-off-by" because of an > > extra space. > > > > regards > > sudip > > > > Sending this again. I'm sorry. BTW, are you adding this manually? Let git add these Signed-off-by and you do not need to worry about these anymore. regards sudip ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:57 ` Sudip Mukherjee @ 2015-10-29 5:59 ` Shivani Bhardwaj 2015-10-29 6:00 ` Shivani Bhardwaj 0 siblings, 1 reply; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 5:59 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 1015 bytes --] On Thu, Oct 29, 2015 at 11:27 AM, Sudip Mukherjee < sudipm.mukherjee@gmail.com> wrote: > On Thu, Oct 29, 2015 at 11:24:59AM +0530, Shivani Bhardwaj wrote: > > On Thu, Oct 29, 2015 at 11:18 AM, Sudip Mukherjee < > > sudipm.mukherjee@gmail.com> wrote: > > > > > On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: > > > > Remove return statement from the function lstcon_group_ndlink_move() > > > > as its return type is void. > > > > Fix checkpatch WARNING: void function return statements are not > > > > generally useful > > > > > > > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> > > > > > > checkpatch is complaining about the "Signed-off-by" because of an > > > extra space. > > > > > > regards > > > sudip > > > > > > > Sending this again. I'm sorry. > > BTW, are you adding this manually? Let git add these Signed-off-by and > you do not need to worry about these anymore. > > regards > sudip > I fixed the commit message by git commit --amend. Did I do anything wrong? Thank you [-- Attachment #2: Type: text/html, Size: 1779 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 5:59 ` Shivani Bhardwaj @ 2015-10-29 6:00 ` Shivani Bhardwaj 2015-10-29 10:46 ` Sudip Mukherjee 0 siblings, 1 reply; 9+ messages in thread From: Shivani Bhardwaj @ 2015-10-29 6:00 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 1177 bytes --] On Thu, Oct 29, 2015 at 11:29 AM, Shivani Bhardwaj <shivanib134@gmail.com> wrote: > > > On Thu, Oct 29, 2015 at 11:27 AM, Sudip Mukherjee < > sudipm.mukherjee@gmail.com> wrote: > >> On Thu, Oct 29, 2015 at 11:24:59AM +0530, Shivani Bhardwaj wrote: >> > On Thu, Oct 29, 2015 at 11:18 AM, Sudip Mukherjee < >> > sudipm.mukherjee@gmail.com> wrote: >> > >> > > On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: >> > > > Remove return statement from the function lstcon_group_ndlink_move() >> > > > as its return type is void. >> > > > Fix checkpatch WARNING: void function return statements are not >> > > > generally useful >> > > > >> > > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> >> > > >> > > checkpatch is complaining about the "Signed-off-by" because of an >> > > extra space. >> > > >> > > regards >> > > sudip >> > > >> > >> > Sending this again. I'm sorry. >> >> BTW, are you adding this manually? Let git add these Signed-off-by and >> you do not need to worry about these anymore. >> >> regards >> sudip >> > > I fixed the commit message by git commit --amend. Did I do anything wrong? > Thank you > And, should I be sending it again? [-- Attachment #2: Type: text/html, Size: 2274 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement 2015-10-29 6:00 ` Shivani Bhardwaj @ 2015-10-29 10:46 ` Sudip Mukherjee 0 siblings, 0 replies; 9+ messages in thread From: Sudip Mukherjee @ 2015-10-29 10:46 UTC (permalink / raw) To: Shivani Bhardwaj; +Cc: outreachy-kernel On Thu, Oct 29, 2015 at 11:30:17AM +0530, Shivani Bhardwaj wrote: > On Thu, Oct 29, 2015 at 11:29 AM, Shivani Bhardwaj <shivanib134@gmail.com> > wrote: > > > > > > > On Thu, Oct 29, 2015 at 11:27 AM, Sudip Mukherjee < > > sudipm.mukherjee@gmail.com> wrote: > > > >> On Thu, Oct 29, 2015 at 11:24:59AM +0530, Shivani Bhardwaj wrote: > >> > On Thu, Oct 29, 2015 at 11:18 AM, Sudip Mukherjee < > >> > sudipm.mukherjee@gmail.com> wrote: > >> > > >> > > On Thu, Oct 29, 2015 at 11:02:48AM +0530, Shivani Bhardwaj wrote: > >> > > > Remove return statement from the function lstcon_group_ndlink_move() > >> > > > as its return type is void. > >> > > > Fix checkpatch WARNING: void function return statements are not > >> > > > generally useful > >> > > > > >> > > > Signed-off-by : Shivani Bhardwaj <shivanib134@gmail.com> > >> > > > >> > > checkpatch is complaining about the "Signed-off-by" because of an > >> > > extra space. > >> > > > >> > > regards > >> > > sudip > >> > > > >> > > >> > Sending this again. I'm sorry. > >> > >> BTW, are you adding this manually? Let git add these Signed-off-by and > >> you do not need to worry about these anymore. > >> > >> regards > >> sudip > >> > > > > I fixed the commit message by git commit --amend. Did I do anything wrong? > > Thank you > > > > And, should I be sending it again? I am seeing that you have already sent it, but I think Greg will be confused by that patch. regards sudip ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-29 10:46 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-29 5:31 [PATCH 0/2] Remove unnecessary functions and clean up the code Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 1/2] Staging: lustre: console: Drop unnecessary wrapper function Shivani Bhardwaj 2015-10-29 5:32 ` [PATCH 2/2] Staging: lustre: console: Remove irrelevant return statement Shivani Bhardwaj 2015-10-29 5:48 ` [Outreachy kernel] " Sudip Mukherjee 2015-10-29 5:54 ` Shivani Bhardwaj 2015-10-29 5:57 ` Sudip Mukherjee 2015-10-29 5:59 ` Shivani Bhardwaj 2015-10-29 6:00 ` Shivani Bhardwaj 2015-10-29 10:46 ` Sudip Mukherjee
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.