block: sed-opal: Remove always false conditional statement
authorRevanth Rajashekar <revanth.rajashekar@intel.com>
Tue, 20 Aug 2019 15:30:50 +0000 (09:30 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Aug 2019 15:33:21 +0000 (09:33 -0600)
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>
block/sed-opal.c

index d442f29e84f129f41c960a05644cf3c456763dc9..4e95a9792162582d5a4c7bd4fc48f95a5135fcec 100644 (file)
@@ -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;