[PATCH 2/2] nvme-core: remove extra condition for vwc

Keith Busch kbusch at kernel.org
Thu Oct 1 14:06:01 EDT 2020


On Wed, Sep 30, 2020 at 04:24:47PM -0700, Chaitanya Kulkarni wrote:
> @@ -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 ? true : false;

No need for a ternary here. It can just be:

	bool vwc = ctrl->vwc & NVME_CTRL_VWC_PRESENT;



More information about the Linux-nvme mailing list