From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15655223328; Thu, 28 May 2026 20:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000381; cv=none; b=Zc0RN0rA73KZdBiq7PH9v0C5b6+cxilm5JFEq+3LdYe4RUnDECCzBBALh0PPvyrSjzZkrOJj60TsmCGWyWlmLHUeqLPWq9qDg+L2gK5wx/iRL7+WEJDsIua/74gzmQE2rpbI6cRobp/HBQQ0d9Vf/jx+NfNLzICeYYGHn1fFM9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000381; c=relaxed/simple; bh=H8pvIMVhpf78HAop2kTpG3eUTaK3K7TiYsRLTQFbIw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HMg+za/AuoCKwLrkHWDF74zUm0pdrh6m5pNq4vbv9SesHR7aA3iHMXYmVm0GqBSLbeKYDRvIAGU4VuA/2y7hO73xel+bc3CoQho5TTEoXswnj48p9h3/6bTMkzlbQaUKGxrcKl46Lm5Y7POe6AGyVnN3Z/B0mMI8dg6lMgZ/19g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VVifZrL6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VVifZrL6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E1D81F000E9; Thu, 28 May 2026 20:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000380; bh=97bS1vhcgYYWQSFKRjgBQP7nCm6iucmBc8SbFc0UG1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VVifZrL690l2hYDYzWhruCcU4iVPq4FZBXTd3anIfoNKB5HXT4vWZxQgR3oRCIrdw fQggyyGMz5N+Im1D6KXgiNtJCEQHroAkmQd9Vs53wAYwPfB3NQdmVRtxkwT8zKgVMI 4T0i20vE+YVAWLw1SogUVMUOUJCsbvr7jiaDopUE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tommy Kelly , Damien Le Moal , Niklas Cassel Subject: [PATCH 6.12 025/272] ata: libata-scsi: improve readability of ata_scsi_qc_issue() Date: Thu, 28 May 2026 21:46:39 +0200 Message-ID: <20260528194630.091049604@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194629.379955525@linuxfoundation.org> References: <20260528194629.379955525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel commit 360190bd965f93794d5f5685a6de22ce6da2b672 upstream. Improve readability of ata_scsi_qc_issue(). No functional changes. Tested-by: Tommy Kelly Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-scsi.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1779,7 +1779,7 @@ static int ata_scsi_qc_issue(struct ata_ int ret; if (!ap->ops->qc_defer) - goto issue; + goto issue_qc; /* * If we already have a deferred qc, then rely on the SCSI layer to @@ -1798,38 +1798,37 @@ static int ata_scsi_qc_issue(struct ata_ break; case ATA_DEFER_LINK: ret = SCSI_MLQUEUE_DEVICE_BUSY; - break; + goto defer_qc; case ATA_DEFER_PORT: ret = SCSI_MLQUEUE_HOST_BUSY; - break; + goto defer_qc; default: WARN_ON_ONCE(1); ret = SCSI_MLQUEUE_HOST_BUSY; - break; + goto defer_qc; } - if (ret) { - /* - * We must defer this qc: if this is not an NCQ command, keep - * this qc as a deferred one and report to the SCSI layer that - * we issued it so that it is not requeued. The deferred qc will - * be issued with the port deferred_qc_work once all on-going - * commands complete. - */ - if (!ata_is_ncq(qc->tf.protocol)) { - ap->deferred_qc = qc; - return 0; - } +issue_qc: + ata_qc_issue(qc); + return 0; - /* Force a requeue of the command to defer its execution. */ - ata_qc_free(qc); - return ret; +defer_qc: + /* + * We must defer this qc: if this is not an NCQ command, keep + * this qc as a deferred one and report to the SCSI layer that + * we issued it so that it is not requeued. The deferred qc will + * be issued with the port deferred_qc_work once all on-going + * commands complete. + */ + if (!ata_is_ncq(qc->tf.protocol)) { + ap->deferred_qc = qc; + return 0; } -issue: - ata_qc_issue(qc); + /* Force a requeue of the command to defer its execution. */ + ata_qc_free(qc); - return 0; + return ret; } /**