Skip to content

Commit

Permalink
block: sed-opal: Remove always false conditional statement
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Revanth Rajashekar authored and Jens Axboe committed Aug 20, 2019
1 parent 5cc23ed commit 89c6cc2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions block/sed-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 89c6cc2

Please sign in to comment.