From patchwork Tue Nov 15 19:11:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9430381 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 C01DC60755 for ; Tue, 15 Nov 2016 19:12:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF53228C67 for ; Tue, 15 Nov 2016 19:12:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A457A28C69; Tue, 15 Nov 2016 19:12:12 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 5374C28C68 for ; Tue, 15 Nov 2016 19:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935091AbcKOTMK (ORCPT ); Tue, 15 Nov 2016 14:12:10 -0500 Received: from mail-pg0-f53.google.com ([74.125.83.53]:34633 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935055AbcKOTMI (ORCPT ); Tue, 15 Nov 2016 14:12:08 -0500 Received: by mail-pg0-f53.google.com with SMTP id x23so66865315pgx.1 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:in-reply-to:references :in-reply-to:references; bh=3KE+t+5ujM8YFo3fbeuh0a6hR98XhsfIOlSih9X/PTU=; b=NUT8F2/zSEi2F/mTav9ewJcg2C4O+SruLTAVOhqYRy+Iy2XEmZA5pxEgdD8a/jTuhG KiEX3BZsFr2DXySQz1yBWbEJ7M3xj3oVaYcnArK2/BDoB7src4NIId922AjbwrF/KYN3 QHSWg1MAd+HpyEWbUwEO4y4gT9Sgr70BXltWAf86ovLitj0l6vNJkR6qUB1SeA0wouIc ArMVLtwa5v+Dz8RERg+QEqGWSoqiKBW/1FAI5PYAQRTD+O68n8Fsi//6Hg+o3X9Aa584 7WVGlwubMqbXpDVgNYynYTMv3MiyOZHAGOl7DZfw9Dz3sgzKSPCqaUwul10TnU7Z1v2Y TTtQ== 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:in-reply-to :references:in-reply-to:references; bh=3KE+t+5ujM8YFo3fbeuh0a6hR98XhsfIOlSih9X/PTU=; b=Z6O2/MttDd3atOZ7t87fiQl7SpL4qMSerHxFcjKFonno9m8wF96BGbCIYnTpSRDO6Y zEuizZDEjGyZbTW7K5tl+ifa/p8bKm9LqoL/D4fvJaIOFC/pkBFv0mq/oeXGT5lTcLQ3 03Djjeo32zd5WOIsqPIMoXZ1G3iJ30XFaDIxQOnwr+vNbnTPuBgbLga3qZPwsSGFgWJU IcoDEJPSIEHLqoXWTGhQASwX24MEGpX1YTWg7SA1Dvqll7cINMKshUmEmAVrkCpDe0vm GbjmO3/uDGWyoyzvgrb9kazTatUiNXUOU7i7rD3Olhkg3Yhb1qi7Z10LLUZHR+PRBKAh 1/mg== X-Gm-Message-State: ABUngvcK+FFuN/sJ42WPLWq6dcIovsihO0WzdIu64NMLqV1ApxdzDy2C8sPJMuSSxVAbXk9Z X-Received: by 10.98.218.87 with SMTP id w23mr3655366pfl.85.1479237127375; Tue, 15 Nov 2016 11:12:07 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2016 11:12:07 -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 2/2] scsi_lib: untangle 0 and BLK_MQ_RQ_QUEUE_OK Date: Tue, 15 Nov 2016 11:11:59 -0800 Message-Id: X-Mailer: git-send-email 2.10.2 In-Reply-To: References: In-Reply-To: References: 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 --- drivers/scsi/scsi_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 2e35132..47a5c87 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1810,7 +1810,7 @@ static inline int prep_to_mq(int ret) { switch (ret) { case BLKPREP_OK: - return 0; + return BLK_MQ_RQ_QUEUE_OK; case BLKPREP_DEFER: return BLK_MQ_RQ_QUEUE_BUSY; default: @@ -1897,7 +1897,7 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, int reason; ret = prep_to_mq(scsi_prep_state_check(sdev, req)); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) goto out; ret = BLK_MQ_RQ_QUEUE_BUSY; @@ -1914,7 +1914,7 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, if (!(req->rq_flags & RQF_DONTPREP)) { ret = prep_to_mq(scsi_mq_prep_fn(req)); - if (ret) + if (ret != BLK_MQ_RQ_QUEUE_OK) goto out_dec_host_busy; req->rq_flags |= RQF_DONTPREP; } else {