Linux-Raid Archives mirror
 help / color / mirror / Atom feed
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
To: linux-raid@vger.kernel.org
Cc: mariusz.tkaczyk@linux.intel.com, jes@trained-monkey.org
Subject: [PATCH] Remove all "if zeros" pt.2
Date: Tue, 19 Mar 2024 11:15:29 +0100	[thread overview]
Message-ID: <20240319101529.5098-1-mateusz.kusiak@intel.com> (raw)

Commit e15e8b00cbce ("Remove all "if zeros"") did not remove all "if 0"
code blocks.

This commit is cleanup for that commit.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
---
 Build.c  |  6 ------
 Grow.c   | 13 +------------
 super1.c | 11 -----------
 3 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/Build.c b/Build.c
index 1fbf8596a9dd..1be90e418ad1 100644
--- a/Build.c
+++ b/Build.c
@@ -156,12 +156,6 @@ int Build(struct mddev_ident *ident, struct mddev_dev *devlist, struct shape *s,
 		bitmap_fd = open(s->bitmap_file, O_RDWR);
 		if (bitmap_fd < 0) {
 			int major = BITMAP_MAJOR_HI;
-#if 0
-			if (s->bitmap_chunk == UnSet) {
-				pr_err("%s cannot be opened.\n", s->bitmap_file);
-				goto abort;
-			}
-#endif
 			bitmapsize = s->size >> 9; /* FIXME wrong for RAID10 */
 			if (CreateBitmap(s->bitmap_file, 1, NULL,
 					 s->bitmap_chunk, c->delay,
diff --git a/Grow.c b/Grow.c
index 5498e54fec11..97782fbc48cf 100644
--- a/Grow.c
+++ b/Grow.c
@@ -4417,19 +4417,8 @@ static void validate(int afd, int bfd, unsigned long long offset)
 		lseek64(afd, __le64_to_cpu(bsb2.arraystart)*512, 0);
 		if ((unsigned long long)read(afd, abuf, len) != len)
 			fail("read first from array failed");
-		if (memcmp(bbuf, abuf, len) != 0) {
-#if 0
-			int i;
-			printf("offset=%llu len=%llu\n",
-			       (unsigned long long)__le64_to_cpu(bsb2.arraystart)*512, len);
-			for (i=0; i<len; i++)
-				if (bbuf[i] != abuf[i]) {
-					printf("first diff byte %d\n", i);
-					break;
-				}
-#endif
+		if (memcmp(bbuf, abuf, len) != 0)
 			fail("data1 compare failed");
-		}
 	}
 	if (bsb2.length2) {
 		unsigned long long len = __le64_to_cpu(bsb2.length2)*512;
diff --git a/super1.c b/super1.c
index 871d19f0398c..0d059b4321b8 100644
--- a/super1.c
+++ b/super1.c
@@ -575,17 +575,6 @@ static void examine_super1(struct supertype *st, char *homehost)
 			inconsistent = 1;
 		}
 	}
-#if 0
-	/* This is confusing too */
-	faulty = 0;
-	for (i = 0; i < __le32_to_cpu(sb->max_dev); i++) {
-		int role = __le16_to_cpu(sb->dev_roles[i]);
-		if (role == MD_DISK_ROLE_FAULTY)
-			faulty++;
-	}
-	if (faulty)
-		printf(" %d failed", faulty);
-#endif
 	printf(" ('A' == active, '.' == missing, 'R' == replacing)");
 	printf("\n");
 	for (d = 0; d < __le32_to_cpu(sb->max_dev); d++) {
-- 
2.39.2


             reply	other threads:[~2024-03-19 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 10:15 Mateusz Kusiak [this message]
2024-03-22 11:23 ` [PATCH] Remove all "if zeros" pt.2 Mariusz Tkaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240319101529.5098-1-mateusz.kusiak@intel.com \
    --to=mateusz.kusiak@intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).