[PATCH 1/2] nvme: update nvme_cancel_io() a bit

Keith Busch keith.busch at intel.com
Wed May 18 08:11:33 PDT 2016


On Tue, May 17, 2016 at 10:56:58PM -0700, Ming Lin wrote:
>  static void nvme_cancel_io(struct request *req, void *data, bool reserved)
>  {
> +	struct nvme_ctrl *ctrl = data;
>  	int status;
>  
>  	if (!blk_mq_request_started(req))
>  		return;
>  
> -	dev_dbg_ratelimited(((struct nvme_dev *) data)->ctrl.device,
> -				"Cancelling I/O %d", req->tag);
> +	dev_dbg_ratelimited(ctrl->device, "Cancelling I/O %d", req->tag);

Since you're not using ctrl for anything but the debug print, you
should remove declaring it and instead do like what's currently there.
This way the driver doesn't produce an unused variable warning in some
kernel configurations. See commit 7e197930 that fixed this before.

Otherwise, looks fine.



More information about the Linux-nvme mailing list