Skip to content

Commit c448525

Browse files
ChaitanayaKulkarniChristoph Hellwig
authored andcommitted
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>
1 parent af5d6f7 commit c448525

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
19701970
static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
19711971
struct request_queue *q)
19721972
{
1973-
bool vwc = false;
1973+
bool vwc = ctrl->vwc & NVME_CTRL_VWC_PRESENT;
19741974

19751975
if (ctrl->max_hw_sectors) {
19761976
u32 max_segments =
@@ -1982,8 +1982,6 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
19821982
}
19831983
blk_queue_virt_boundary(q, NVME_CTRL_PAGE_SIZE - 1);
19841984
blk_queue_dma_alignment(q, 7);
1985-
if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
1986-
vwc = true;
19871985
blk_queue_write_cache(q, vwc, vwc);
19881986
}
19891987

0 commit comments

Comments
 (0)