staging: lustre: libcfs: drop trivially useless initialization
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 20 Jun 2015 19:07:49 +0000 (21:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jul 2015 02:37:04 +0000 (19:37 -0700)
Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/fail.c
drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c

index 7b7fc215e633298025042a650cb86f0985552444..42d615fbd664f9ba90552690dfd614a52ac2ea8d 100644 (file)
@@ -123,7 +123,7 @@ EXPORT_SYMBOL(__cfs_fail_check_set);
 
 int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
 {
-       int ret = 0;
+       int ret;
 
        ret = __cfs_fail_check_set(id, value, set);
        if (ret) {
index 31a558115a96b427d9453dd6bc1ac385a278fa73..933525c73da1ba24e1e35b69e6358171d31bd8fb 100644 (file)
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(cfs_cpt_table_free);
 int
 cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, int len)
 {
-       int     rc = 0;
+       int     rc;
 
        rc = snprintf(buf, len, "%d\t: %d\n", 0, 0);
        len -= rc;