From patchwork Tue Nov 15 19:11:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9430377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 731B060469 for ; Tue, 15 Nov 2016 19:12:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 625E028C67 for ; Tue, 15 Nov 2016 19:12:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5712428C69; Tue, 15 Nov 2016 19:12:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3FB328C67 for ; Tue, 15 Nov 2016 19:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934857AbcKOTMI (ORCPT ); Tue, 15 Nov 2016 14:12:08 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35846 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935038AbcKOTMH (ORCPT ); Tue, 15 Nov 2016 14:12:07 -0500 X-Greylist: delayed 69719 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 14:12:07 EST Received: by mail-pg0-f50.google.com with SMTP id f188so69457189pgc.3 for ; Tue, 15 Nov 2016 11:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=If8sPoh3rI4xLsk9VNU1e7QoxBU+NpsoNRgAMIgk87Q=; b=jhT/nm0uGUAxUts8UGc0Pvq7UL9ovbub7mPql1brhDs+2XsgB3fWzxArnIlhfiiH5f weQFksudQizorg/xiVnJ4QaF05pBwqANV+/Qycvub3R600enFYKhM9GW3mFJS37M7/cP 6ZO27HpdtnsHL02iZqSqIXUubHFLgBp0DlkmnQOjxP6dpKoZ7yY/rCGO0rrLQYpYAIb1 s6Ks4bCmJiiuQXgowDPsNaltFyDwHcMNFdpb+cuMy//x5v4P39NadyPqYUNtzo34LFuq Y1LTx9y2l2P48C/zw6YLcQVozLuwzJEG9tX6QWd4OB+HOu9KTJTM/uPVJAqYABBW1QlS jkqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=If8sPoh3rI4xLsk9VNU1e7QoxBU+NpsoNRgAMIgk87Q=; b=hLkmjmEy6WRJ/wV3hNyaj2IxRQftK9nyUIIrTH8ufPpc+UVlNKs+998JY4Y2Rgus3x rxn583jt4H/WZ6b7sSbLICo+oCuCjuCjNSlSQB4kRwmt2CjSTLSbq5Lo1SIYa1fRNO4o RtB/iKyHfLYJF0NamlJ6u+K91b9OPaOxCl8nPZPco0IOROZNluLYhHNfjcXkYs9snA9h vbdwAFX2dDJaOOGOnPZrQvDWor+6uOjTdvX4QPiulJSlH90+6pywl1h9/9vwavQN+d63 sIjDoJOgrZ7h1AOQOwIHheUMY/ADUKFiQijs9NL+9YIjOoW+4cKjSgyKyf1igHEKzq7O +WAA== X-Gm-Message-State: ABUngvcS6tIkRpFD2PzbAgV+Nij3R/0ZrycsYpasIq9JIYuC1kfTxdl/6gMtU2qYhvwSx+b9 X-Received: by 10.98.16.7 with SMTP id y7mr32243027pfi.55.1479237126643; Tue, 15 Nov 2016 11:12:06 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:200::d:2b09]) by smtp.gmail.com with ESMTPSA id 16sm26904334pfk.54.2016.11.15.11.12.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2016 11:12:06 -0800 (PST) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 1/2] nvme: untangle 0 and BLK_MQ_RQ_QUEUE_OK Date: Tue, 15 Nov 2016 11:11:58 -0800 Message-Id: X-Mailer: git-send-email 2.10.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval Let's not depend on any of the BLK_MQ_RQ_QUEUE_* constants having specific values. No functional change. Signed-off-by: Omar Sandoval Reviewed-by: Keith Busch --- drivers/nvme/host/core.c | 4 ++-- drivers/nvme/host/pci.c | 8 ++++---- drivers/nvme/host/rdma.c | 2 +- drivers/nvme/target/loop.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 53584d2..e54bb10 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -269,7 +269,7 @@ static inline int nvme_setup_discard(struct nvme_ns *ns, struct request *req, */ req->__data_len = nr_bytes; - return 0; + return BLK_MQ_RQ_QUEUE_OK; } static inline void nvme_setup_rw(struct nvme_ns *ns, struct request *req, @@ -317,7 +317,7 @@ static inline void nvme_setup_rw(struct nvme_ns *ns, struct request *req, int nvme_setup_cmd(struct nvme_ns *ns, struct request *req, struct nvme_command *cmd) { - int ret = 0; + int ret = BLK_MQ_RQ_QUEUE_OK; if (req->cmd_type == REQ_TYPE_DRV_PRIV) memcpy(cmd, nvme_req(req)->cmd, sizeof(*cmd)); diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 51d13d5..d58f8e4 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -328,7 +328,7 @@ static int nvme_init_iod(struct request *rq, unsigned size, rq->retries = 0; rq->rq_flags |= RQF_DONTPREP; } - return 0; + return BLK_MQ_RQ_QUEUE_OK; } static void nvme_free_iod(struct nvme_dev *dev, struct request *req) @@ -598,17 +598,17 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx, map_len = nvme_map_len(req); ret = nvme_init_iod(req, map_len, dev); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) return ret; ret = nvme_setup_cmd(ns, req, &cmnd); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) goto out; if (req->nr_phys_segments) ret = nvme_map_data(dev, req, map_len, &cmnd); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) goto out; cmnd.common.command_id = req->tag; diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index c4700ef..ff1b34060 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1395,7 +1395,7 @@ static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx, sizeof(struct nvme_command), DMA_TO_DEVICE); ret = nvme_setup_cmd(ns, rq, c); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) return ret; c->common.command_id = rq->tag; diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 26aa3a5..be56d05 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -169,7 +169,7 @@ static int nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx, int ret; ret = nvme_setup_cmd(ns, req, &iod->cmd); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) return ret; iod->cmd.common.flags |= NVME_CMD_SGL_METABUF; @@ -179,7 +179,7 @@ static int nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx, nvme_cleanup_cmd(req); blk_mq_start_request(req); nvme_loop_queue_response(&iod->req); - return 0; + return BLK_MQ_RQ_QUEUE_OK; } if (blk_rq_bytes(req)) { @@ -198,7 +198,7 @@ static int nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx, blk_mq_start_request(req); schedule_work(&iod->work); - return 0; + return BLK_MQ_RQ_QUEUE_OK; } static void nvme_loop_submit_async_event(struct nvme_ctrl *arg, int aer_idx)