Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ata: libata-scsi: rename and improve ata_qc_done()

Rename ata_qc_done() to ata_scsi_qc_done() and allow to pass a scsi
command result value to set for the completed command to simplify the
caller sites.

No functional changes.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>

+12 -12
+12 -12
drivers/ata/libata-scsi.c
··· 1649 1649 return 1; 1650 1650 } 1651 1651 1652 - static void ata_qc_done(struct ata_queued_cmd *qc) 1652 + static void ata_scsi_qc_done(struct ata_queued_cmd *qc, bool set_result, 1653 + u32 scmd_result) 1653 1654 { 1654 1655 struct scsi_cmnd *cmd = qc->scsicmd; 1655 1656 void (*done)(struct scsi_cmnd *) = qc->scsidone; 1656 1657 1657 1658 ata_qc_free(qc); 1659 + 1660 + if (set_result) 1661 + cmd->result = scmd_result; 1658 1662 done(cmd); 1659 1663 } 1660 1664 ··· 1697 1693 * do not try to be smart about what to do with this deferred command 1698 1694 * and simply retry it by completing it with DID_SOFT_ERROR. 1699 1695 */ 1700 - if (!qc) 1701 - return; 1702 - 1703 - ap->deferred_qc = NULL; 1704 - qc->scsicmd->result = (DID_SOFT_ERROR << 16); 1705 - ata_qc_done(qc); 1696 + if (qc) { 1697 + ap->deferred_qc = NULL; 1698 + ata_scsi_qc_done(qc, true, DID_SOFT_ERROR << 16); 1699 + } 1706 1700 } 1707 1701 1708 1702 static void ata_scsi_schedule_deferred_qc(struct ata_port *ap) ··· 1756 1754 ata_scsi_set_sense_information(qc); 1757 1755 } 1758 1756 1759 - ata_qc_done(qc); 1757 + ata_scsi_qc_done(qc, false, 0); 1760 1758 1761 1759 ata_scsi_schedule_deferred_qc(ap); 1762 1760 } ··· 2915 2913 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) 2916 2914 qc->dev->sdev->locked = 0; 2917 2915 2918 - qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; 2919 - ata_qc_done(qc); 2916 + ata_scsi_qc_done(qc, true, SAM_STAT_CHECK_CONDITION); 2920 2917 return; 2921 2918 } 2922 2919 2923 2920 /* successful completion path */ 2924 2921 if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0) 2925 2922 atapi_fixup_inquiry(cmd); 2926 - cmd->result = SAM_STAT_GOOD; 2927 2923 2928 - ata_qc_done(qc); 2924 + ata_scsi_qc_done(qc, true, SAM_STAT_GOOD); 2929 2925 } 2930 2926 /** 2931 2927 * atapi_xlat - Initialize PACKET taskfile