All of lore.kernel.org
 help / color / mirror / Atom feed
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 v3 2/3] block: sed-opal: Remove always false conditional statement
Date: Tue, 20 Aug 2019 09:30:50 -0600	[thread overview]
Message-ID: <20190820153051.24704-3-revanth.rajashekar@intel.com> (raw)
In-Reply-To: <20190820153051.24704-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>
Reviewed-by: Scott Bauer <sbauer@plzdonthack.me>
Reviewed-by: Jon Derrick <jonathan.derrick@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


  parent reply	other threads:[~2019-08-20 15:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 15:30 [PATCH v3 0/3] block: sed-opal: Code Cleanup Patches Revanth Rajashekar
2019-08-20 15:30 ` [PATCH v3 1/3] block: sed-opal: Add/remove spaces Revanth Rajashekar
2019-08-20 15:30 ` Revanth Rajashekar [this message]
2019-08-20 15:30 ` [PATCH v3 3/3] block: sed-opal: Removed duplicate OPAL_METHOD_LENGTH definition Revanth Rajashekar
2019-08-20 15:35 ` [PATCH v3 0/3] block: sed-opal: Code Cleanup Patches Jens Axboe

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=20190820153051.24704-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.