Skip to contentSkip to conversation

staging: lustre: lustre: Remove unneeded else after goto

PATCH New Janani Ravichandran 1 participant 1 message Feb 18, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: lustre: Remove unneeded else after goto

Remove unnecessary else following an if block with a goto statement.

---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 3 ++-
 drivers/staging/lustre/lustre/lov/lov_obd.c            | 5 ++---
 drivers/staging/lustre/lustre/lov/lov_pack.c           | 5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c +2 -1
index e52afe3..e3c3854 100644
@@ -854,7 +854,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;
drivers/staging/lustre/lustre/lov/lov_obd.c +2 -3
index d72c313..a9dda2a 100644
@@ -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) {
drivers/staging/lustre/lustre/lov/lov_pack.c +3 -2
index a78211f..4b35d65 100644
@@ -404,8 +404,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;
 	}
Signature · 1 line
2.5.0