[PATCH 01/12] staging/lustre/ldlm: Delete unnecessary checks before the function call "kset_unregister"

SF Markus Elfring
2016-07-26T18:57:07Z

Date: Tue, 26 Jul 2016 11:33:43 +0200

The kset_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index 821939f..2c1c2fc 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -1067,10 +1067,8 @@ static int ldlm_cleanup(void)
if (ldlm_state->ldlm_cb_service)
ptlrpc_unregister_service(ldlm_state->ldlm_cb_service);

- if (ldlm_ns_kset)
- kset_unregister(ldlm_ns_kset);
- if (ldlm_svc_kset)
- kset_unregister(ldlm_svc_kset);
+ kset_unregister(ldlm_ns_kset);
+ kset_unregister(ldlm_svc_kset);
if (ldlm_kobj)
kobject_put(ldlm_kobj);

--
2.9.2