staging: lustre: ptlrpc: remove unused variable
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Fri, 27 Feb 2015 12:55:16 +0000 (14:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 00:26:48 +0000 (16:26 -0800)
This patch removes a variable that was simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/nrs.c

index d5fd7215c72f9dcc24d2e1210d8876937f817da4..371af9c7ba89c48ca9b87087afd16474cf1240c9 100644 (file)
@@ -912,7 +912,6 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs)
 static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
                                   struct ptlrpc_service_part *svcpt)
 {
-       int                             rc;
        enum ptlrpc_nrs_queue_type      queue;
 
        LASSERT(mutex_is_locked(&nrs_core.nrs_mutex));
@@ -930,9 +929,7 @@ static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
        INIT_LIST_HEAD(&nrs->nrs_policy_list);
        INIT_LIST_HEAD(&nrs->nrs_policy_queued);
 
-       rc = nrs_register_policies_locked(nrs);
-
-       return rc;
+       return nrs_register_policies_locked(nrs);
 }
 
 /**