]> Git Repo - linux.git/commitdiff
nvme-core: remove extra condition for vwc
authorChaitanya Kulkarni <[email protected]>
Thu, 1 Oct 2020 18:54:32 +0000 (11:54 -0700)
committerChristoph Hellwig <[email protected]>
Wed, 7 Oct 2020 05:56:20 +0000 (07:56 +0200)
In nvme_set_queue_limits() we initialize vwc to false and later add
a condition to set vwc true. The value of the vwc can be declare
initialized which makes all the blk_queue_XXX() calls uniform.

Signed-off-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
drivers/nvme/host/core.c

index 2e505cdf051ec1ae4630ac6ea2f36a35d7e02c14..e85f6304efd72b19a632bf8b541264e5c0a28575 100644 (file)
@@ -1970,7 +1970,7 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
 static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
                struct request_queue *q)
 {
-       bool vwc = false;
+       bool vwc = ctrl->vwc & NVME_CTRL_VWC_PRESENT;
 
        if (ctrl->max_hw_sectors) {
                u32 max_segments =
@@ -1982,8 +1982,6 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
        }
        blk_queue_virt_boundary(q, NVME_CTRL_PAGE_SIZE - 1);
        blk_queue_dma_alignment(q, 7);
-       if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
-               vwc = true;
        blk_queue_write_cache(q, vwc, vwc);
 }
 
This page took 0.060306 seconds and 4 git commands to generate.