[PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code.
Christoph Hellwig
hch at infradead.org
Mon Dec 19 22:49:01 PST 2016
> +void nvme_unlock_from_suspend(struct nvme_ctrl *ctrl)
> +{
> + if (opal_unlock_from_suspend(&ctrl->sed_ctx))
> + pr_warn("Failed to unlock one or more locking ranges!\n");
> +}
> +EXPORT_SYMBOL_GPL(nvme_unlock_from_suspend);
I don't think we even need this wrapper. Also for the warning please
use dev_warn so that the user knows which controller failed.
> @@ -1765,7 +1766,7 @@ static void nvme_reset_work(struct work_struct *work)
> {
> struct nvme_dev *dev = container_of(work, struct nvme_dev, reset_work);
> int result = -ENODEV;
> -
> + bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);
> if (WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING))
Please don't remove the empty line after the variable declarations.
Also I would place your new line before the result line, as that makes
it a tad easier to read.
More information about the Linux-nvme
mailing list