diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2020-10-01 11:54:32 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-10-07 07:56:20 +0200 |
commit | c4485252cf36ae62c8bf12c4aede72345cad0d2b (patch) | |
tree | 147c2de92c23672b08cb476d65e03d21c7458713 /drivers/nvme | |
parent | af5d6f7ba5f99f8316473557240ae9acdd20a6bd (diff) | |
download | linux-c4485252cf36ae62c8bf12c4aede72345cad0d2b.tar.bz2 |
nvme-core: remove extra condition for vwc
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 <chaitanya.kulkarni@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 2e505cdf051e..e85f6304efd7 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -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); } |