diff mbox

lightnvm: Remove redundant rq->__data_len initialization

Message ID 20180627195319.13417-1-bart.vanassche@wdc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bart Van Assche June 27, 2018, 7:53 p.m. UTC
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>
---
 drivers/nvme/host/lightnvm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Matias Bjorling June 27, 2018, 7:57 p.m. UTC | #1
On 06/27/2018 09:53 PM, Bart Van Assche wrote:
> 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>
> ---
>   drivers/nvme/host/lightnvm.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
> index 41279da799ed..a76db8820f1c 100644
> --- a/drivers/nvme/host/lightnvm.c
> +++ b/drivers/nvme/host/lightnvm.c
> @@ -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;
>   }
> 

Thanks Bart. I've picked it up for 4.19.
diff mbox

Patch

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 41279da799ed..a76db8820f1c 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -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;
 }