[PATCH 3/3] Kill(): Remove redundant check and dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

No need to check for (force && rv >=2) since we just set rv = 0 in
that case.

In addition remove dead code path that checks rv != 0 inside code that
is only run for rv == 0.

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 Kill.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/Kill.c b/Kill.c
index b841a5b..01d884f 100644
--- a/Kill.c
+++ b/Kill.c
@@ -63,7 +63,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
 	rv = st->ss->load_super(st, fd, dev);
 	if (force && rv >= 2)
 		rv = 0; /* ignore bad data in superblock */
-	if (rv== 0 || (force && rv >= 2)) {
+	if (rv == 0) {
 		st->ss->free_super(st);
 		st->ss->init_super(st, NULL, 0, "", NULL, NULL);
 		if (st->ss->store_super(st, fd)) {
@@ -71,10 +71,6 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
 				fprintf(stderr, Name ": Could not zero superblock on %s\n",
 					dev);
 			rv = 1;
-		} else if (rv) {
-			if (!quiet)
-				fprintf(stderr, Name ": superblock zeroed anyway\n");
-			rv = 0;
 		}
 	}
 	close(fd);
-- 
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux