Skip to contentSkip to conversation

scsi: aacraid: Improve code readability

PATCH Applied Bart Van Assche 3 participants 4 messages Oct 21, 2025 – Oct 30, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: aacraid: Improve code readability

aac_queuecommand() is a scsi_host_template.queuecommand() implementation. Any value returned by this function other than one of the following values is translated into SCSI_MLQUEUE_HOST_BUSY:
* 0
* SCSI_MLQUEUE_HOST_BUSY
* SCSI_MLQUEUE_DEVICE_BUSY
* SCSI_MLQUEUE_EH_RETRY
* SCSI_MLQUEUE_TARGET_BUSY

Improve readability of aac_queuecommand() by returning SCSI_MLQUEUE_HOST_BUSY instead of FAILED.

Cc Gilbert Wu <[email protected]>
Cc Sagar Biradar <[email protected]>
Cc John Garry <[email protected]>

---

Changes compared to v1: instead of failing a SCSI command if aac_scsi_cmd()
returns a value that is not zero, let the SCSI core retry the command.

 drivers/scsi/aacraid/linit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/linit.c +1 -1
index ea66196ef7c7..82c6e7c7cdaf 100644
@@ -242,7 +242,7 @@ static int aac_queuecommand(struct Scsi_Host *shost,
 {
 	aac_priv(cmd)->owner = AAC_OWNER_LOWLEVEL;
 
-	return aac_scsi_cmd(cmd) ? FAILED : 0;
+	return aac_scsi_cmd(cmd) ? SCSI_MLQUEUE_HOST_BUSY : 0;
 }
 
 /**
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Bart Van Assche

aac_queuecommand() is a scsi_host_template.queuecommand() implementation. Any value returned by this function other than one of the following values is translated into SCSI_MLQUEUE_HOST_BUSY:
* 0
* SCSI_MLQUEUE_HOST_BUSY
* SCSI_MLQUEUE_DEVICE_BUSY
* SCSI_MLQUEUE_EH_RETRY
* SCSI_MLQUEUE_TARGET_BUSY

Quoted 7 lines

Improve readability of aac_queuecommand() by returning SCSI_MLQUEUE_HOST_BUSY instead of FAILED.

Cc Gilbert Wu <[email protected]>
Cc Sagar Biradar <[email protected]>
Cc John Garry <[email protected]>
Quoted 21 lines

---

Changes compared to v1: instead of failing a SCSI command if aac_scsi_cmd()
returns a value that is not zero, let the SCSI core retry the command.

  drivers/scsi/aacraid/linit.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/linit.c +1 -1
index ea66196ef7c7..82c6e7c7cdaf 100644
@@ -242,7 +242,7 @@ static int aac_queuecommand(struct Scsi_Host *shost,
  {
  	aac_priv(cmd)->owner = AAC_OWNER_LOWLEVEL;
 
-	return aac_scsi_cmd(cmd) ? FAILED : 0;
+	return aac_scsi_cmd(cmd) ? SCSI_MLQUEUE_HOST_BUSY : 0;
  }
 
  /**
#2 lore raw
In reply to Bart Van Assche

Bart,

Quoted 3 lines

aac_queuecommand() is a scsi_host_template.queuecommand() implementation. Any value returned by this function other than one of the following values is translated into SCSI_MLQUEUE_HOST_BUSY:

Applied to 6.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
#3 lore raw
In reply to Bart Van Assche
Quoted 10 lines · Bart Van Assche

aac_queuecommand() is a scsi_host_template.queuecommand() implementation. Any value returned by this function other than one of the following values is translated into SCSI_MLQUEUE_HOST_BUSY:
* 0
* SCSI_MLQUEUE_HOST_BUSY
* SCSI_MLQUEUE_DEVICE_BUSY
* SCSI_MLQUEUE_EH_RETRY
* SCSI_MLQUEUE_TARGET_BUSY

[...]

Applied to 6.19/scsi-queue, thanks!

[1/1] scsi: aacraid: Improve code readability

      https://git.kernel.org/mkp/scsi/c/e414748b7e83
Signature · 1 line
Martin K. Petersen