From: Vishal Verma <vishal.l.verma@intel.com>
To: <linux-nvdimm@lists.01.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>
Subject: [ndctl PATCH 2/2] ndctl/inject-error: remove logically dead code
Date: Thu, 1 Oct 2020 13:38:16 -0600 [thread overview]
Message-ID: <20201001193816.975987-2-vishal.l.verma@intel.com> (raw)
In-Reply-To: <20201001193816.975987-1-vishal.l.verma@intel.com>
Static analysis reports that the bb != NULL check is redundant because
ndctl_namespace_bb_foreach already uses that as a loop condition. Remove
it.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
ndctl/inject-error.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/ndctl/inject-error.c b/ndctl/inject-error.c
index fe599ef..f6be6a5 100644
--- a/ndctl/inject-error.c
+++ b/ndctl/inject-error.c
@@ -255,9 +255,6 @@ static int injection_status(struct ndctl_namespace *ndns)
}
ndctl_namespace_bb_foreach(ndns, bb) {
- if (!bb)
- break;
-
block = ndctl_bb_get_block(bb);
count = ndctl_bb_get_count(bb);
jbb = util_badblock_rec_to_json(block, count, ictx.json_flags);
--
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
prev parent reply other threads:[~2020-10-01 19:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 19:38 [ndctl PATCH 1/2] libndctl: fix a potential buffer overflow Vishal Verma
2020-10-01 19:38 ` Vishal Verma [this message]
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=20201001193816.975987-2-vishal.l.verma@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
/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 NNTP newsgroup(s).