From: Revanth Rajashekar <revanth.rajashekar@intel.com>
To: <linux-block@vger.kernel.org>
Cc: Jonathan Derrick <jonathan.derrick@intel.com>,
Scott Bauer <sbauer@plzdonthack.me>,
Revanth Rajashekar <revanth.rajashekar@intel.com>
Subject: [PATCH 2/3] block: sed-opal: Eliminating the dead error
Date: Tue, 13 Aug 2019 15:43:39 -0600 [thread overview]
Message-ID: <20190813214340.15533-3-revanth.rajashekar@intel.com> (raw)
In-Reply-To: <20190813214340.15533-1-revanth.rajashekar@intel.com>
In the function 'response_parse', num_entries will never be 0 as
slen is checked for 0. Hence, the condition 'if (num_entries == 0)'
can never be true.
Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
---
block/sed-opal.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/block/sed-opal.c b/block/sed-opal.c
index d442f29e84f1..4e95a9792162 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -905,10 +905,6 @@ static int response_parse(const u8 *buf, size_t length,
num_entries++;
}
- if (num_entries == 0) {
- pr_debug("Couldn't parse response.\n");
- return -EINVAL;
- }
resp->num = num_entries;
return 0;
--
2.17.1
next prev parent reply other threads:[~2019-08-13 21:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 21:43 [PATCH 0/3] block: sed-opal: Code Cleanup Patches Revanth Rajashekar
2019-08-13 21:43 ` [PATCH 1/3] block: sed-opal: Add/remove spaces Revanth Rajashekar
2019-08-14 20:26 ` Derrick, Jonathan
2019-08-15 4:01 ` Scott Bauer
2019-08-13 21:43 ` Revanth Rajashekar [this message]
2019-08-14 20:33 ` [PATCH 2/3] block: sed-opal: Eliminating the dead error Derrick, Jonathan
2019-08-15 4:03 ` Scott Bauer
2019-08-13 21:43 ` [PATCH 3/3] block: sed-opal: OPAL_METHOD_LENGTH defined twice Revanth Rajashekar
2019-08-14 20:34 ` Derrick, Jonathan
2019-08-15 4:07 ` Scott Bauer
2019-08-15 16:08 ` Rajashekar, Revanth
2019-08-13 22:28 ` [PATCH 0/3] block: sed-opal: Code Cleanup Patches Derrick, Jonathan
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=20190813214340.15533-3-revanth.rajashekar@intel.com \
--to=revanth.rajashekar@intel.com \
--cc=jonathan.derrick@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=sbauer@plzdonthack.me \
/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).