OSDN Git Service

staging: lustre: lustre: Remove unneeded else after goto
authorJanani Ravichandran <janani.rvchndrn@gmail.com>
Thu, 18 Feb 2016 22:15:48 +0000 (17:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:39:54 +0000 (14:39 -0800)
Remove unnecessary else following an if block with a goto statement.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lov_pack.c

index 7318b77..389fb9e 100644 (file)
@@ -850,7 +850,8 @@ cfs_cpt_table_create_pattern(char *pattern)
                        if (*str != 0) {
                                CERROR("Invalid pattern %s\n", str);
                                goto failed;
-                       } else if (c != ncpt) {
+                       }
+                       if (c != ncpt) {
                                CERROR("expect %d partitions but found %d\n",
                                       ncpt, c);
                                goto failed;
index 90314c9..dcaa5a1 100644 (file)
@@ -399,10 +399,9 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
                        CDEBUG(D_INFO, "OSC %s already %sactive!\n",
                               uuid->uuid, active ? "" : "in");
                        goto out;
-               } else {
-                       CDEBUG(D_CONFIG, "Marking OSC %s %sactive\n",
-                              obd_uuid2str(uuid), active ? "" : "in");
                }
+               CDEBUG(D_CONFIG, "Marking OSC %s %sactive\n",
+                      obd_uuid2str(uuid), active ? "" : "in");
 
                lov->lov_tgts[index]->ltd_active = active;
                if (active) {
index 4680160..4d8abb9 100644 (file)
@@ -402,8 +402,9 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
        if (copy_from_user(&lum, lump, lum_size)) {
                rc = -EFAULT;
                goto out_set;
-       } else if ((lum.lmm_magic != LOV_USER_MAGIC) &&
-                (lum.lmm_magic != LOV_USER_MAGIC_V3)) {
+       }
+       if ((lum.lmm_magic != LOV_USER_MAGIC) &&
+           (lum.lmm_magic != LOV_USER_MAGIC_V3)) {
                rc = -EINVAL;
                goto out_set;
        }