lightnvm: Remove redundant rq->__data_len initialization
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 13 Jul 2018 08:48:39 +0000 (10:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Jul 2018 14:14:36 +0000 (08:14 -0600)
Since both blk_old_get_request() and blk_mq_alloc_request() initialize
rq->__data_len to zero, it is not necessary to initialize that member
in nvme_nvm_alloc_request(). Hence remove the rq->__data_len
initialization from nvme_nvm_alloc_request().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/lightnvm.c

index 41279da799ed8b4fb1eb88d742d14b0f6631bce6..a76db8820f1c99e98b7c4acdb4dffd64c3f0369b 100644 (file)
@@ -662,12 +662,10 @@ static struct request *nvme_nvm_alloc_request(struct request_queue *q,
 
        rq->cmd_flags &= ~REQ_FAILFAST_DRIVER;
 
-       if (rqd->bio) {
+       if (rqd->bio)
                blk_init_request_from_bio(rq, rqd->bio);
-       } else {
+       else
                rq->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM);
-               rq->__data_len = 0;
-       }
 
        return rq;
 }