]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: Change the return type of the .queuecommand() callback
authorBart Van Assche <bvanassche@acm.org>
Thu, 15 Jan 2026 21:03:41 +0000 (13:03 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 24 Jan 2026 02:32:34 +0000 (21:32 -0500)
In clang version 21.1 and later the -Wimplicit-enum-enum-cast warning
option has been introduced. This warning is enabled by default and can
be used to catch .queuecommand() implementations that return another
value than 0 or one of the SCSI_MLQUEUE_* constants. Hence this patch
that changes the return type of the .queuecommand() implementations from
'int' into 'enum scsi_qc_status'. No functionality has been changed.

Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260115210357.2501991-6-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
104 files changed:
Documentation/scsi/scsi_mid_low_api.rst
drivers/ata/libata-scsi.c
drivers/ata/libata.h
drivers/firewire/sbp2.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptscsih.h
drivers/message/fusion/mptspi.c
drivers/s390/scsi/zfcp_scsi.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-sas.c
drivers/scsi/3w-xxxx.c
drivers/scsi/53c700.c
drivers/scsi/BusLogic.c
drivers/scsi/BusLogic.h
drivers/scsi/NCR5380.c
drivers/scsi/a100u2w.c
drivers/scsi/aacraid/linit.c
drivers/scsi/advansys.c
drivers/scsi/aha152x.c
drivers/scsi/aha1542.c
drivers/scsi/aha1740.c
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/arm/acornscsi.c
drivers/scsi/arm/fas216.c
drivers/scsi/arm/fas216.h
drivers/scsi/atp870u.c
drivers/scsi/bfa/bfad_im.c
drivers/scsi/bnx2fc/bnx2fc.h
drivers/scsi/bnx2fc/bnx2fc_io.c
drivers/scsi/csiostor/csio_scsi.c
drivers/scsi/dc395x.c
drivers/scsi/esas2r/esas2r.h
drivers/scsi/esas2r/esas2r_main.c
drivers/scsi/esp_scsi.c
drivers/scsi/fdomain.c
drivers/scsi/fnic/fnic.h
drivers/scsi/fnic/fnic_scsi.c
drivers/scsi/hpsa.c
drivers/scsi/hptiop.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/imm.c
drivers/scsi/initio.c
drivers/scsi/ipr.c
drivers/scsi/ips.c
drivers/scsi/libfc/fc_fcp.c
drivers/scsi/libiscsi.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/mac53c94.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid.h
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/mesh.c
drivers/scsi/mpi3mr/mpi3mr_os.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/mvumi.c
drivers/scsi/myrb.c
drivers/scsi/myrs.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/nsp32.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/nsp_cs.h
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/scsi/pmcraid.c
drivers/scsi/ppa.c
drivers/scsi/ps3rom.c
drivers/scsi/qedf/qedf.h
drivers/scsi/qedf/qedf_io.c
drivers/scsi/qla1280.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/qlogicfas408.c
drivers/scsi/qlogicfas408.h
drivers/scsi/qlogicpti.c
drivers/scsi/scsi_debug.c
drivers/scsi/smartpqi/smartpqi_init.c
drivers/scsi/snic/snic.h
drivers/scsi/snic/snic_scsi.c
drivers/scsi/stex.c
drivers/scsi/storvsc_drv.c
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/virtio_scsi.c
drivers/scsi/vmw_pvscsi.c
drivers/scsi/wd33c93.c
drivers/scsi/wd33c93.h
drivers/scsi/wd719x.c
drivers/scsi/xen-scsifront.c
drivers/target/loopback/tcm_loop.c
drivers/ufs/core/ufshcd.c
drivers/usb/image/microtek.c
drivers/usb/storage/scsiglue.c
drivers/usb/storage/uas.c
include/linux/libata.h
include/scsi/libfc.h
include/scsi/libiscsi.h
include/scsi/libsas.h
include/scsi/scsi_host.h

index 634f5c28a8490d76496fc026efef35ba6f63ca4a..7f59dff43eb549194323a8d490595e5ed24adf9f 100644 (file)
@@ -903,7 +903,8 @@ Details::
     *
     *      Defined in: LLD
     **/
-       int queuecommand(struct Scsi_Host *shost, struct scsi_cmnd * scp)
+       enum scsi_qc_status queuecommand(struct Scsi_Host *shost,
+                                        struct scsi_cmnd *scp)
 
 
     /**
index 721d3f270c8ec61da3cfc93494f675ca769ec97f..2967a2900317102b1b0e98fdc22eb910676b3e35 100644 (file)
@@ -4309,7 +4309,8 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
        return NULL;
 }
 
-int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev)
+enum scsi_qc_status __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
+                                       struct ata_device *dev)
 {
        struct ata_port *ap = dev->link->ap;
        u8 scsi_op = scmd->cmnd[0];
@@ -4383,12 +4384,13 @@ int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev)
  *     Return value from __ata_scsi_queuecmd() if @cmd can be queued,
  *     0 otherwise.
  */
-int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
+enum scsi_qc_status ata_scsi_queuecmd(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *cmd)
 {
        struct ata_port *ap;
        struct ata_device *dev;
        struct scsi_device *scsidev = cmd->device;
-       int rc = 0;
+       enum scsi_qc_status rc = 0;
        unsigned long irq_flags;
 
        ap = ata_shost_to_port(shost);
index 0e7ecac73680987d8b65bc4319cf0eb0858f5fab..0e48bd1c0c206c8bb622287478a10e2635942354 100644 (file)
@@ -164,7 +164,8 @@ extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
 void ata_scsi_sdev_config(struct scsi_device *sdev);
 int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,
                struct ata_device *dev);
-int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev);
+enum scsi_qc_status __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
+                                       struct ata_device *dev);
 
 /* libata-eh.c */
 extern unsigned int ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd);
index 1a19828114cf76aea454c82e57cf538a8570ee10..bb1a510b64239beab196ce17d9fc01b55d8fd12e 100644 (file)
@@ -1440,13 +1440,14 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,
 
 /* SCSI stack integration */
 
-static int sbp2_scsi_queuecommand(struct Scsi_Host *shost,
-                                 struct scsi_cmnd *cmd)
+static enum scsi_qc_status sbp2_scsi_queuecommand(struct Scsi_Host *shost,
+                                                 struct scsi_cmnd *cmd)
 {
        struct sbp2_logical_unit *lu = cmd->device->hostdata;
        struct fw_device *device = target_parent_device(lu->tgt);
+       enum scsi_qc_status retval = SCSI_MLQUEUE_HOST_BUSY;
        struct sbp2_command_orb *orb;
-       int generation, retval = SCSI_MLQUEUE_HOST_BUSY;
+       int generation;
 
        orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
        if (orb == NULL)
index 23ed2fc688f0b398bb63856aa6a604a4ff1e2c41..c4291071deb969faae42cfe03e52350d5fdc33fb 100644 (file)
@@ -2148,7 +2148,8 @@ static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc,
        target->qp_in_error = true;
 }
 
-static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
+static enum scsi_qc_status srp_queuecommand(struct Scsi_Host *shost,
+                                           struct scsi_cmnd *scmnd)
 {
        struct request *rq = scsi_cmd_to_rq(scmnd);
        struct srp_target_port *target = host_to_target(shost);
index 8f587c0efd9db9a33d885ea9bc1bb654a5534a64..cd52db6fe76c3855b01d866c76b1835b93e6a241 100644 (file)
@@ -97,7 +97,8 @@ static u8     mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;
 
 static int mptfc_target_alloc(struct scsi_target *starget);
 static int mptfc_sdev_init(struct scsi_device *sdev);
-static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt);
+static enum scsi_qc_status mptfc_qcmd(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *SCpnt);
 static void mptfc_target_destroy(struct scsi_target *starget);
 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
 static void mptfc_remove(struct pci_dev *pdev);
@@ -676,8 +677,8 @@ mptfc_sdev_init(struct scsi_device *sdev)
        return 0;
 }
 
-static int
-mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status mptfc_qcmd(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *SCpnt)
 {
        struct mptfc_rport_info *ri;
        struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
index 185c08eab4ca1d9aa7ccf07f645f16d4844b289e..5276bdb7acc2749f0b751840a9279b6b66e8608e 100644 (file)
@@ -1920,8 +1920,8 @@ mptsas_sdev_init(struct scsi_device *sdev)
        return 0;
 }
 
-static int
-mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status mptsas_qcmd(struct Scsi_Host *shost,
+                                      struct scsi_cmnd *SCpnt)
 {
        MPT_SCSI_HOST   *hd;
        MPT_ADAPTER     *ioc;
index 3304f8824cf790803f0c2cf6aa3bed1322f4f22b..ec6edcc4ef5687f5b91e06ded65c9f5a660dfd38 100644 (file)
@@ -1309,8 +1309,7 @@ int mptscsih_show_info(struct seq_file *m, struct Scsi_Host *host)
  *
  *     Returns 0. (rtn value discarded by linux scsi mid-layer)
  */
-int
-mptscsih_qcmd(struct scsi_cmnd *SCpnt)
+enum scsi_qc_status mptscsih_qcmd(struct scsi_cmnd *SCpnt)
 {
        MPT_SCSI_HOST           *hd;
        MPT_FRAME_HDR           *mf;
index f9678d48100c7fe74f24773679881af7f51ac25f..ac3f56801c92a8a33507705df53401e93d06bfd6 100644 (file)
@@ -113,7 +113,7 @@ extern int mptscsih_resume(struct pci_dev *pdev);
 #endif
 extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
 extern const char * mptscsih_info(struct Scsi_Host *SChost);
-extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
+extern enum scsi_qc_status mptscsih_qcmd(struct scsi_cmnd *SCpnt);
 extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
        u8 id, u64 lun, int ctx2abort, ulong timeout);
 extern void mptscsih_sdev_destroy(struct scsi_device *device);
index a3901fbfac4f7555b1f45f123ea64c47b98f4bc9..14707d19fbbd3992bfddcd2805b0731a4de92f5a 100644 (file)
@@ -774,8 +774,8 @@ static int mptspi_sdev_configure(struct scsi_device *sdev,
        return 0;
 }
 
-static int
-mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status mptspi_qcmd(struct Scsi_Host *shost,
+                                      struct scsi_cmnd *SCpnt)
 {
        struct _MPT_SCSI_HOST *hd = shost_priv(shost);
        VirtDevice      *vdevice = SCpnt->device->hostdata;
index 141476ea21bbfc66d4a4cc6f417cbf2296f2c01d..634bd8dceedd743c220301d48bf547056326f04b 100644 (file)
@@ -63,8 +63,8 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
        scsi_done(scpnt);
 }
 
-static
-int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt)
+static enum scsi_qc_status zfcp_scsi_queuecommand(struct Scsi_Host *shost,
+                                                 struct scsi_cmnd *scpnt)
 {
        struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device);
        struct fc_rport *rport = starget_to_rport(scsi_target(scpnt->device));
index a377a6f6900aad17a6c822babd46262a922145d5..e64a9a18ec6e14ca07b2b09692fc29c445e772cc 100644 (file)
@@ -1746,7 +1746,7 @@ out:
 } /* End twa_scsi_eh_reset() */
 
 /* This is the main scsi queue function to handle scsi opcodes */
-static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status twa_scsi_queue_lck(struct scsi_cmnd *SCpnt)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        int request_id, retval;
index e319be7d369c989dfdfc562aee11f5af2f61fd75..fde12475b71244e2ea37258a00249b1f11ad7bc6 100644 (file)
@@ -1453,11 +1453,13 @@ out:
 } /* End twl_scsi_eh_reset() */
 
 /* This is the main scsi queue function to handle scsi opcodes */
-static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status twl_scsi_queue_lck(struct scsi_cmnd *SCpnt)
 {
+       TW_Device_Extension *tw_dev =
+               (TW_Device_Extension *)SCpnt->device->host->hostdata;
        void (*done)(struct scsi_cmnd *) = scsi_done;
-       int request_id, retval;
-       TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
+       enum scsi_qc_status retval;
+       int request_id;
 
        /* If we are resetting due to timed out ioctl, report as busy */
        if (test_bit(TW_IN_RESET, &tw_dev->flags)) {
index 0306a228c7028e7652835fc76ccfbd6be0820a8b..c68678fa72c1e555f5fb97cd9b11f5fadfcdf5eb 100644 (file)
@@ -1920,7 +1920,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r
 } /* End tw_scsiop_test_unit_ready_complete() */
 
 /* This is the main scsi queue function to handle scsi opcodes */
-static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status tw_scsi_queue_lck(struct scsi_cmnd *SCpnt)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        unsigned char *command = SCpnt->cmnd;
index 71b7ac027f48fc67c2b53e356419de9d3e56d82e..860538c6f8cbeea7fae46ed580bf7f6f28b6149d 100644 (file)
@@ -152,8 +152,8 @@ MODULE_LICENSE("GPL");
 /* This is the script */
 #include "53c700_d.h"
 
-
-STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *);
+STATIC enum scsi_qc_status NCR_700_queuecommand(struct Scsi_Host *h,
+                                               struct scsi_cmnd *);
 STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
 STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
@@ -1751,7 +1751,7 @@ NCR_700_intr(int irq, void *dev_id)
        return IRQ_RETVAL(handled);
 }
 
-static int NCR_700_queuecommand_lck(struct scsi_cmnd *SCp)
+static enum scsi_qc_status NCR_700_queuecommand_lck(struct scsi_cmnd *SCp)
 {
        struct NCR_700_Host_Parameters *hostdata = 
                (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
index a86d780d1ba40c4df9230b8fb7bd2194234c8b8b..865fcbac8fa1700168cc5d14e89e973f70cf4c1e 100644 (file)
@@ -2877,7 +2877,7 @@ static int blogic_hostreset(struct scsi_cmnd *SCpnt)
   Outgoing Mailbox for execution by the associated Host Adapter.
 */
 
-static int blogic_qcmd_lck(struct scsi_cmnd *command)
+static enum scsi_qc_status blogic_qcmd_lck(struct scsi_cmnd *command)
 {
        void (*comp_cb)(struct scsi_cmnd *) = scsi_done;
        struct blogic_adapter *adapter =
index 79de815e33b00a6fc45f27882d4a553a6a44ef23..24697a5bedc8b7175dd3cff1381ce8ac15210c34 100644 (file)
@@ -1272,7 +1272,8 @@ static inline void blogic_incszbucket(unsigned int *cmdsz_buckets,
 */
 
 static const char *blogic_drvr_info(struct Scsi_Host *);
-static int blogic_qcmd(struct Scsi_Host *h, struct scsi_cmnd *);
+static enum scsi_qc_status blogic_qcmd(struct Scsi_Host *h,
+                                      struct scsi_cmnd *command);
 static int blogic_diskparam(struct scsi_device *, struct gendisk *, sector_t, int *);
 static int blogic_sdev_configure(struct scsi_device *,
                                 struct queue_limits *lim);
index 0e10502660def63359a320a4955e3c6453b9ffe5..006dcf9812184d7915bdeb2719b99b9b40ed9c62 100644 (file)
@@ -555,8 +555,8 @@ static void complete_cmd(struct Scsi_Host *instance,
  * main coroutine is not running, it is restarted.
  */
 
-static int NCR5380_queue_command(struct Scsi_Host *instance,
-                                 struct scsi_cmnd *cmd)
+static enum scsi_qc_status NCR5380_queue_command(struct Scsi_Host *instance,
+                                                struct scsi_cmnd *cmd)
 {
        struct NCR5380_hostdata *hostdata = shost_priv(instance);
        struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
index a8979f9e30ffe3f777620c34514cd3a6afd20311..4365b896f5c47bd6bcd29778a0f90697ca576354 100644 (file)
@@ -909,7 +909,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc
  *     block, build the host specific scb structures and if there is room
  *     queue the command down to the controller
  */
-static int inia100_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status inia100_queue_lck(struct scsi_cmnd *cmd)
 {
        struct orc_scb *scb;
        struct orc_host *host;          /* Point to Host adapter control block */
index 82c6e7c7cdaf9e247912c86da7aecafdd95fd4d6..ea468666159a3c4c39cfa55d4f0c536651d00b9e 100644 (file)
@@ -237,8 +237,8 @@ static struct aac_driver_ident aac_drivers[] = {
  *     TODO: unify with aac_scsi_cmd().
  */
 
-static int aac_queuecommand(struct Scsi_Host *shost,
-                           struct scsi_cmnd *cmd)
+static enum scsi_qc_status aac_queuecommand(struct Scsi_Host *shost,
+                                           struct scsi_cmnd *cmd)
 {
        aac_priv(cmd)->owner = AAC_OWNER_LOWLEVEL;
 
index 06223b5ee6daeb8e70465e52b7e1ddac98cfe38d..08bddac49757a7b47ff30ceb2b693dc544a61768 100644 (file)
@@ -8462,10 +8462,11 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
  * This function always returns 0. Command return status is saved
  * in the 'scp' result field.
  */
-static int advansys_queuecommand_lck(struct scsi_cmnd *scp)
+static enum scsi_qc_status advansys_queuecommand_lck(struct scsi_cmnd *scp)
 {
        struct Scsi_Host *shost = scp->device->host;
-       int asc_res, result = 0;
+       enum scsi_qc_status result = 0;
+       int asc_res;
 
        ASC_STATS(shost, queuecommand);
 
index f7879c81d9cb630c421d25b081bf3dc0ad765233..e3ccb6bb62c00b927e60d91a1f093adb7d350271 100644 (file)
@@ -924,7 +924,7 @@ static int setup_expected_interrupts(struct Scsi_Host *shpnt)
 /*
  *  Queue a command and setup interrupts for a free bus.
  */
-static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
+static enum scsi_qc_status aha152x_internal_queue(struct scsi_cmnd *SCpnt,
                                  struct completion *complete, int phase)
 {
        struct aha152x_cmd_priv *acp = aha152x_priv(SCpnt);
@@ -995,7 +995,7 @@ static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
  *  queue a command
  *
  */
-static int aha152x_queue_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status aha152x_queue_lck(struct scsi_cmnd *SCpnt)
 {
        return aha152x_internal_queue(SCpnt, NULL, 0);
 }
index 371e8300f02918a81ade50ff190ba832ade485a1..fd766282d4a4002e47938634fe079001f994f34c 100644 (file)
@@ -411,7 +411,8 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
        }
 }
 
-static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
+static enum scsi_qc_status aha1542_queuecommand(struct Scsi_Host *sh,
+                                               struct scsi_cmnd *cmd)
 {
        struct aha1542_cmd *acmd = scsi_cmd_priv(cmd);
        struct aha1542_hostdata *aha1542 = shost_priv(sh);
index b234621f6b3792c6491bb82c44995ece190fc292..c435769359f224383b90378d5f8ad4d828ec3d5a 100644 (file)
@@ -319,7 +319,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
        return IRQ_RETVAL(handled);
 }
 
-static int aha1740_queuecommand_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status aha1740_queuecommand_lck(struct scsi_cmnd *SCpnt)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        unchar direction;
index c3d1b9dd24ae343362e86f03eefe8809aefb1dc4..c8b6dc48300a41507cc26e091558c10407431c0d 100644 (file)
@@ -359,7 +359,7 @@ static void ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd);
 static u_int ahd_linux_user_tagdepth(struct ahd_softc *ahd,
                                     struct ahd_devinfo *devinfo);
 static void ahd_linux_device_queue_depth(struct scsi_device *);
-static int ahd_linux_run_command(struct ahd_softc*,
+static enum scsi_qc_status ahd_linux_run_command(struct ahd_softc*,
                                 struct ahd_linux_device *,
                                 struct scsi_cmnd *);
 static void ahd_linux_setup_tag_info_global(char *p);
@@ -577,11 +577,11 @@ ahd_linux_info(struct Scsi_Host *host)
 /*
  * Queue an SCB to the controller.
  */
-static int ahd_linux_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status ahd_linux_queue_lck(struct scsi_cmnd *cmd)
 {
-       struct   ahd_softc *ahd;
-       struct   ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
-       int rtn = SCSI_MLQUEUE_HOST_BUSY;
+       struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
+       enum scsi_qc_status rtn = SCSI_MLQUEUE_HOST_BUSY;
+       struct ahd_softc *ahd;
 
        ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
 
@@ -1535,7 +1535,7 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev)
        }
 }
 
-static int
+static enum scsi_qc_status
 ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
                      struct scsi_cmnd *cmd)
 {
index 8b2b98666d61890b8117f2a38b5769d8603a3b1d..c71f80f8fa343755145a1713a3ec0e5b6cdcdbff 100644 (file)
@@ -519,11 +519,11 @@ ahc_linux_info(struct Scsi_Host *host)
 /*
  * Queue an SCB to the controller.
  */
-static int ahc_linux_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status ahc_linux_queue_lck(struct scsi_cmnd *cmd)
 {
        struct   ahc_softc *ahc;
        struct   ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
-       int rtn = SCSI_MLQUEUE_HOST_BUSY;
+       enum scsi_qc_status rtn = SCSI_MLQUEUE_HOST_BUSY;
        unsigned long flags;
 
        ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
index f0c5a30ce51bda9a1f6dbca4d3be12b5ce5ebf77..8aa948f06cacf124c390866501facea5d5b33d83 100644 (file)
@@ -113,7 +113,8 @@ static int arcmsr_abort(struct scsi_cmnd *);
 static int arcmsr_bus_reset(struct scsi_cmnd *);
 static int arcmsr_bios_param(struct scsi_device *sdev,
                struct gendisk *disk, sector_t capacity, int *info);
-static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
+static enum scsi_qc_status arcmsr_queue_command(struct Scsi_Host *h,
+                                               struct scsi_cmnd *cmd);
 static int arcmsr_probe(struct pci_dev *pdev,
                                const struct pci_device_id *id);
 static int __maybe_unused arcmsr_suspend(struct device *dev);
@@ -3312,7 +3313,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
        }
 }
 
-static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status arcmsr_queue_command_lck(struct scsi_cmnd *cmd)
 {
        struct Scsi_Host *host = cmd->device->host;
        struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
index ef21b85cf014650df8608cfc6f1937f2c2d217dc..79d7d7336b6ac7c6396deef706264afc73584b7f 100644 (file)
@@ -2408,7 +2408,7 @@ acornscsi_intr(int irq, void *dev_id)
  * Params   : cmd  - SCSI command
  * Returns  : 0, or < 0 on error.
  */
-static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt)
 {
     struct scsi_pointer *scsi_pointer = arm_scsi_pointer(SCpnt);
     void (*done)(struct scsi_cmnd *) = scsi_done;
index b1a749ab18f84dcd086156f640251a96cec0ad2d..fccfacaaf1d52e5a834410d20598cb0447b726b3 100644 (file)
@@ -2202,11 +2202,12 @@ no_command:
  * Returns: 0 on success, else error.
  * Notes: io_request_lock is held, interrupts are disabled.
  */
-static int fas216_queue_command_internal(struct scsi_cmnd *SCpnt,
-                                        void (*done)(struct scsi_cmnd *))
+static enum scsi_qc_status
+fas216_queue_command_internal(struct scsi_cmnd *SCpnt,
+                             void (*done)(struct scsi_cmnd *))
 {
        FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
-       int result;
+       enum scsi_qc_status result;
 
        fas216_checkmagic(info);
 
@@ -2243,7 +2244,7 @@ static int fas216_queue_command_internal(struct scsi_cmnd *SCpnt,
        return result;
 }
 
-static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status fas216_queue_command_lck(struct scsi_cmnd *SCpnt)
 {
        return fas216_queue_command_internal(SCpnt, scsi_done);
 }
@@ -2273,7 +2274,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)
  * Returns: scsi result code.
  * Notes: io_request_lock is held, interrupts are disabled.
  */
-static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt)
 {
        FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
 
index 08113277a2a973d40e473072b9b7067cd61d47c8..29f710f9cb512b5fee0d73a67471be5315bad4b9 100644 (file)
@@ -338,21 +338,24 @@ extern int fas216_init (struct Scsi_Host *instance);
  */
 extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
 
-/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt)
+/* Function: enum scsi_qc_status fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt)
  * Purpose : queue a command for adapter to process.
  * Params  : h - host adapter
  *        : SCpnt - Command to queue
  * Returns : 0 - success, else error
  */
-extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt);
+extern enum scsi_qc_status fas216_queue_command(struct Scsi_Host *h,
+                                               struct scsi_cmnd *SCpnt);
 
-/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt)
+/* Function: enum scsi_qc_status fas216_noqueue_command(struct Scsi_Host *h,
+ * struct scsi_cmnd *SCpnt)
  * Purpose : queue a command for adapter to process, and process it to completion.
  * Params  : h - host adapter
  *        : SCpnt - Command to queue
  * Returns : 0 - success, else error
  */
-extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *);
+extern enum scsi_qc_status fas216_noqueue_command(struct Scsi_Host *h,
+                                                 struct scsi_cmnd *SCpnt);
 
 /* Function: irqreturn_t fas216_intr (FAS216_Info *info)
  * Purpose : handle interrupts from the interface to progress a command
index df6f40b51deb19288f06869a5226c78d2a897a10..67459d81f479e4ef4ac24926a24c55a9778a43c5 100644 (file)
@@ -617,7 +617,7 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
  *
  *     Queue a command to the ATP queue. Called with the host lock held.
  */
-static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p)
+static enum scsi_qc_status atp870u_queuecommand_lck(struct scsi_cmnd *req_p)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        unsigned char c;
index f56e008ee52b1d5cb1d2788c0cdf0ba4a4f89f49..6c84982c472653bc275cdffaea0471fd15dcd29d 100644 (file)
@@ -24,7 +24,8 @@ DEFINE_IDR(bfad_im_port_index);
 struct scsi_transport_template *bfad_im_scsi_transport_template;
 struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
 static void bfad_im_itnim_work_handler(struct work_struct *work);
-static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd);
+static enum scsi_qc_status bfad_im_queuecommand(struct Scsi_Host *h,
+                                               struct scsi_cmnd *cmnd);
 static int bfad_im_sdev_init(struct scsi_device *sdev);
 static void bfad_im_fc_rport_add(struct bfad_im_port_s  *im_port,
                                struct bfad_itnim_s *itnim);
@@ -1199,7 +1200,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)
 /*
  * Scsi_Host template entry, queue a SCSI command to the BFAD.
  */
-static int bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd)
+static enum scsi_qc_status bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct bfad_im_port_s *im_port =
index 6d47a4d8eed6b8858acd875612f62b6b3065ca99..8c8968ec8cb4f12c7acba3dd49e68cf947d88c36 100644 (file)
@@ -498,7 +498,8 @@ static inline struct bnx2fc_priv *bnx2fc_priv(struct scsi_cmnd *cmd)
 struct bnx2fc_cmd *bnx2fc_cmd_alloc(struct bnx2fc_rport *tgt);
 struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type);
 void bnx2fc_cmd_release(struct kref *ref);
-int bnx2fc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd);
+enum scsi_qc_status bnx2fc_queuecommand(struct Scsi_Host *host,
+                                       struct scsi_cmnd *sc_cmd);
 int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba);
 int bnx2fc_send_fw_fcoe_destroy_msg(struct bnx2fc_hba *hba);
 int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
index 33057908f1477922d13144e4b6230609a6de79ca..90b2b54c549a41fd36835f438b6ff65b91051f9b 100644 (file)
@@ -1836,8 +1836,8 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
  *
  * This is the IO strategy routine, called by SCSI-ML
  **/
-int bnx2fc_queuecommand(struct Scsi_Host *host,
-                       struct scsi_cmnd *sc_cmd)
+enum scsi_qc_status bnx2fc_queuecommand(struct Scsi_Host *host,
+                                       struct scsi_cmnd *sc_cmd)
 {
        struct fc_lport *lport = shost_priv(host);
        struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
index 34bde6650fae0fc3d87907420d6902a54a2c725f..c29bf2807e310406aa9e2c9fcec4b1511047a6b9 100644 (file)
@@ -1775,8 +1775,8 @@ csio_scsi_cbfn(struct csio_hw *hw, struct csio_ioreq *req)
  *     - Kicks off the SCSI state machine for this IO.
  *     - Returns busy status on error.
  */
-static int
-csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd)
+static enum scsi_qc_status csio_queuecommand(struct Scsi_Host *host,
+                                            struct scsi_cmnd *cmnd)
 {
        struct csio_lnode *ln = shost_priv(host);
        struct csio_hw *hw = csio_lnode_to_hw(ln);
index 386c8359e1cc8aca062acdd421dee2fe30904544..9dc499c89d3e13b85cd779b212dc336bc14062a4 100644 (file)
@@ -873,7 +873,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
  *        and is expected to be held on return.
  *
  */
-static int dc395x_queue_command_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status dc395x_queue_command_lck(struct scsi_cmnd *cmd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct DeviceCtlBlk *dcb;
index c48275d53aef3d45c0b8a1c38f5a21020ab33102..a763edd05fe49c012378da06654101d9ca839ce3 100644 (file)
@@ -968,7 +968,8 @@ int esas2r_ioctl_handler(void *hostdata, unsigned int cmd, void __user *arg);
 int esas2r_ioctl(struct scsi_device *dev, unsigned int cmd, void __user *arg);
 u8 handle_hba_ioctl(struct esas2r_adapter *a,
                    struct atto_ioctl *ioctl_hba);
-int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd);
+enum scsi_qc_status esas2r_queuecommand(struct Scsi_Host *host,
+                                       struct scsi_cmnd *cmd);
 int esas2r_show_info(struct seq_file *m, struct Scsi_Host *sh);
 long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
 
index be6bf518eb7ca02d7befcec683c9ed294a206d85..fdcffc871d19fc009908bacce35cf9bd487887cd 100644 (file)
@@ -818,7 +818,8 @@ static u32 get_physaddr_from_sgc(struct esas2r_sg_context *sgc, u64 *addr)
        return len;
 }
 
-int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
+enum scsi_qc_status esas2r_queuecommand(struct Scsi_Host *host,
+                                       struct scsi_cmnd *cmd)
 {
        struct esas2r_adapter *a =
                (struct esas2r_adapter *)cmd->device->host->hostdata;
index 802718ffad846a1e2fd14a4ff75406b64899aa13..05647ccc3c8aa5df065651c814c38bf16787b425 100644 (file)
@@ -952,7 +952,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)
        scsi_track_queue_full(dev, lp->num_tagged - 1);
 }
 
-static int esp_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status esp_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        struct scsi_device *dev = cmd->device;
        struct esp *esp = shost_priv(dev->host);
index c0b2a980db34d8e649c4a2ec68dc14525ddb004e..22fbb0222f07de31a727560f880ddef363bb7122 100644 (file)
@@ -402,7 +402,8 @@ static irqreturn_t fdomain_irq(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int fdomain_queue(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
+static enum scsi_qc_status fdomain_queue(struct Scsi_Host *sh,
+                                        struct scsi_cmnd *cmd)
 {
        struct scsi_pointer *scsi_pointer = fdomain_scsi_pointer(cmd);
        struct fdomain *fd = shost_priv(cmd->device->host);
index 1199d701c3f5903bf81aa8eda4781348077e9589..42237eb3222ff1562df71ec4296c906d5afa0b1e 100644 (file)
@@ -503,7 +503,8 @@ void fnic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf);
 void fnic_flush_tx(struct work_struct *work);
 void fnic_update_mac_locked(struct fnic *, u8 *new);
 
-int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+enum scsi_qc_status fnic_queuecommand(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *sc);
 int fnic_abort_cmd(struct scsi_cmnd *);
 int fnic_device_reset(struct scsi_cmnd *);
 int fnic_eh_host_reset_handler(struct scsi_cmnd *sc);
index 75b29a018d1f3a3d0237e790581231ce5d709ff3..29d7aca06958ece6156bd788a1c9de50086d44ad 100644 (file)
@@ -454,7 +454,8 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
        return 0;
 }
 
-int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
+enum scsi_qc_status fnic_queuecommand(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *sc)
 {
        struct request *const rq = scsi_cmd_to_rq(sc);
        uint32_t mqtag = 0;
index 3654b12c5d5a75bebd7c41635f489aa62cd09887..3e235dbfb67ae6c269732a5ca12b482fc34334a6 100644 (file)
@@ -276,7 +276,8 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h);
 #define VPD_PAGE (1 << 8)
 #define HPSA_SIMPLE_ERROR_BITS 0x03
 
-static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
+static enum scsi_qc_status hpsa_scsi_queue_command(struct Scsi_Host *h,
+                                                  struct scsi_cmnd *cmd);
 static void hpsa_scan_start(struct Scsi_Host *);
 static int hpsa_scan_finished(struct Scsi_Host *sh,
        unsigned long elapsed_time);
@@ -5667,7 +5668,8 @@ static void hpsa_command_resubmit_worker(struct work_struct *work)
 }
 
 /* Running in struct Scsi_Host->host_lock less mode */
-static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
+static enum scsi_qc_status hpsa_scsi_queue_command(struct Scsi_Host *sh,
+                                                  struct scsi_cmnd *cmd)
 {
        struct ctlr_info *h;
        struct hpsa_scsi_dev_t *dev;
index 21f1d9871a333fd6e9354c2a2492d226969dfed2..7083c14c53028fa21ac56520abd237f4eee8c9f5 100644 (file)
@@ -993,7 +993,7 @@ static int hptiop_reset_comm_mvfrey(struct hptiop_hba *hba)
        return 0;
 }
 
-static int hptiop_queuecommand_lck(struct scsi_cmnd *scp)
+static enum scsi_qc_status hptiop_queuecommand_lck(struct scsi_cmnd *scp)
 {
        struct Scsi_Host *host = scp->device->host;
        struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata;
index 228daffb286dec659ffa54ab4c12d6751faf14ba..1c370d11b6dd7d07068d0dfebfd2a7fdb86d18ae 100644 (file)
@@ -1960,7 +1960,8 @@ static struct ibmvfc_cmd *ibmvfc_init_vfc_cmd(struct ibmvfc_event *evt, struct s
  * Returns:
  *     0 on success / other on failure
  **/
-static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
+static enum scsi_qc_status ibmvfc_queuecommand(struct Scsi_Host *shost,
+                                              struct scsi_cmnd *cmnd)
 {
        struct ibmvfc_host *vhost = shost_priv(shost);
        struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
index 3d65a498b70190985846c920ebbaa74c2edd92ce..200debd6f7e8c6f41f7ecaec2a2c1e4b2f663765 100644 (file)
@@ -868,9 +868,10 @@ static void ibmvscsi_timeout(struct timer_list *t)
  * Returns the value returned from ibmvscsi_send_crq(). (Zero for success)
  * Note that this routine assumes that host_lock is held for synchronization
 */
-static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
-                                  struct ibmvscsi_host_data *hostdata,
-                                  unsigned long timeout)
+static enum scsi_qc_status
+ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
+                       struct ibmvscsi_host_data *hostdata,
+                       unsigned long timeout)
 {
        __be64 *crq_as_u64 = (__be64 *)&evt_struct->crq;
        int request_status = 0;
@@ -1040,7 +1041,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev)
  * @cmnd:      struct scsi_cmnd to be executed
  * @done:      Callback function to be called when cmd is completed
 */
-static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd)
+static enum scsi_qc_status ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct srp_cmd *srp_cmd;
index 45b0e33293a5917112987807a7a02df73b1ee39e..da7aaac10a73cf7b96fa34d7440cd3a37773da06 100644 (file)
@@ -925,7 +925,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *const cmd)
        return 0;
 }
 
-static int imm_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status imm_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        imm_struct *dev = imm_dev(cmd->device->host);
 
index ed34ad92c80741706feba6e078af0532a6e8d739..06fbe85dccfa63e35d39a159109c59863f6603f7 100644 (file)
@@ -2606,7 +2606,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
  *     zero if successful or indicate a host busy condition if not (which
  *     will cause the mid layer to call us again later with the command)
  */
-static int i91u_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status i91u_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
        struct scsi_ctrl_blk *cmnd;
index dbd58a7e7bc1f3d3b140a19fd091166f3dd2a442..c0487ce38d8dfa4e33d9d35314d145f8610c1aca 100644 (file)
@@ -6242,8 +6242,8 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)
  *     SCSI_MLQUEUE_DEVICE_BUSY if device is busy
  *     SCSI_MLQUEUE_HOST_BUSY if host is busy
  **/
-static int ipr_queuecommand(struct Scsi_Host *shost,
-                           struct scsi_cmnd *scsi_cmd)
+static enum scsi_qc_status ipr_queuecommand(struct Scsi_Host *shost,
+                                           struct scsi_cmnd *scsi_cmd)
 {
        struct ipr_ioa_cfg *ioa_cfg;
        struct ipr_resource_entry *res;
index 3393a288fd23c4c941fbeb5209ce605f019fe247..e2dce28a11c6950d7f04c25275a77786547c112c 100644 (file)
@@ -230,7 +230,7 @@ module_param(ips, charp, 0);
  */
 static int ips_eh_abort(struct scsi_cmnd *);
 static int ips_eh_reset(struct scsi_cmnd *);
-static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *);
+static enum scsi_qc_status ips_queue(struct Scsi_Host *, struct scsi_cmnd *);
 static const char *ips_info(struct Scsi_Host *);
 static irqreturn_t do_ipsintr(int, void *);
 static int ips_hainit(ips_ha_t *);
@@ -1017,7 +1017,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC)
 /*    Linux obtains io_request_lock before calling this function            */
 /*                                                                          */
 /****************************************************************************/
-static int ips_queue_lck(struct scsi_cmnd *SC)
+static enum scsi_qc_status ips_queue_lck(struct scsi_cmnd *SC)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        ips_ha_t *ha;
index 31d08c115521054d021f7d745d9e3463c3acb23f..2f93f6c65a863afd134b55083c71d0e71d4ee87e 100644 (file)
@@ -1854,7 +1854,8 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)
  *
  * This is the i/o strategy routine, called by the SCSI layer.
  */
-int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
+enum scsi_qc_status fc_queuecommand(struct Scsi_Host *shost,
+                                   struct scsi_cmnd *sc_cmd)
 {
        struct fc_lport *lport = shost_priv(shost);
        struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
index c9f410c509783447a2bf6300929e955d49c994d7..25857d6ed6e846bfb908489b046ab726a0113a7d 100644 (file)
@@ -1747,7 +1747,8 @@ enum {
        FAILURE_SESSION_NOT_READY,
 };
 
-int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc)
+enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
+                                      struct scsi_cmnd *sc)
 {
        struct iscsi_cls_session *cls_session;
        struct iscsi_host *ihost;
index ffa5b49aaf087270cb2df34f7908f1a8f36fc7ca..58ee745623325241633fbf9fa5f6ea6ce52056b7 100644 (file)
@@ -157,7 +157,8 @@ static struct sas_task *sas_create_task(struct scsi_cmnd *cmd,
        return task;
 }
 
-int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
+enum scsi_qc_status sas_queuecommand(struct Scsi_Host *host,
+                                    struct scsi_cmnd *cmd)
 {
        struct sas_internal *i = to_sas_internal(host->transportt);
        struct domain_device *dev = cmd_to_domain_dev(cmd);
index 6d9d8c196936afbf56620535d03b869c25e2bea5..df64948e55ee022156797b284507828f34bd7ab9 100644 (file)
@@ -5233,8 +5233,8 @@ static char *lpfc_is_command_vm_io(struct scsi_cmnd *cmd)
  *   0 - Success
  *   SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily.
  **/
-static int
-lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
+static enum scsi_qc_status lpfc_queuecommand(struct Scsi_Host *shost,
+                                            struct scsi_cmnd *cmnd)
 {
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
@@ -6743,8 +6743,8 @@ lpfc_disable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
        return false;
 }
 
-static int
-lpfc_no_command(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
+static enum scsi_qc_status lpfc_no_command(struct Scsi_Host *shost,
+                                          struct scsi_cmnd *cmnd)
 {
        return SCSI_MLQUEUE_HOST_BUSY;
 }
index 377dcab32cd8fe5ed7a23765a6d6e9448642b76e..49f856be2e51d58ffc47641c3d4bdadfe0fcd408 100644 (file)
@@ -66,7 +66,7 @@ static irqreturn_t do_mac53c94_interrupt(int, void *);
 static void cmd_done(struct fsc_state *, int result);
 static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *);
 
-static int mac53c94_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status mac53c94_queue_lck(struct scsi_cmnd *cmd)
 {
        struct fsc_state *state;
 
index 54ed0ba3f48a3c25e9316887d563106ef40d4469..6b088bb049ccef5310fbedf88edd9ed24bba5f22 100644 (file)
@@ -372,11 +372,11 @@ mega_runpendq(adapter_t *adapter)
  *
  * The command queuing entry point for the mid-layer.
  */
-static int megaraid_queue_lck(struct scsi_cmnd *scmd)
+static enum scsi_qc_status megaraid_queue_lck(struct scsi_cmnd *scmd)
 {
        adapter_t       *adapter;
        scb_t   *scb;
-       int     busy=0;
+       enum scsi_qc_status busy = 0;
        unsigned long flags;
 
        adapter = (adapter_t *)scmd->device->host->hostdata;
@@ -518,7 +518,8 @@ mega_get_ldrv_num(adapter_t *adapter, struct scsi_cmnd *cmd, int channel)
  * boot settings.
  */
 static scb_t *
-mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
+mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd,
+              enum scsi_qc_status *busy)
 {
        mega_passthru   *pthru;
        scb_t   *scb;
index d6bfd26a8843e647f60d4ca68c09fcc62ef42735..ecbaa0a0ab516f8c8231ad6924661daa8d5e2a98 100644 (file)
@@ -962,8 +962,10 @@ static int mega_query_adapter(adapter_t *);
 static int issue_scb(adapter_t *, scb_t *);
 static int mega_setup_mailbox(adapter_t *);
 
-static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *);
-static scb_t * mega_build_cmd(adapter_t *, struct scsi_cmnd *, int *);
+static enum scsi_qc_status megaraid_queue(struct Scsi_Host *,
+                                         struct scsi_cmnd *);
+static scb_t *mega_build_cmd(adapter_t *, struct scsi_cmnd *,
+                            enum scsi_qc_status *);
 static void __mega_runpendq(adapter_t *);
 static int issue_scb_block(adapter_t *, u_char *);
 
index 722d3b5acea3658cf1199367305385cd9089c606..b6a32bb0bd19f218163b62f065ed547e95d1646d 100644 (file)
@@ -109,8 +109,10 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);
 static void megaraid_mbox_display_scb(adapter_t *, scb_t *);
 static void megaraid_mbox_setup_device_map(adapter_t *);
 
-static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
-static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *);
+static enum scsi_qc_status megaraid_queue_command(struct Scsi_Host *,
+                                                 struct scsi_cmnd *);
+static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *,
+                                     enum scsi_qc_status *);
 static void megaraid_mbox_runpendq(adapter_t *, scb_t *);
 static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *,
                struct scsi_cmnd *);
@@ -1434,12 +1436,12 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)
  *
  * Queue entry point for mailbox based controllers.
  */
-static int megaraid_queue_command_lck(struct scsi_cmnd *scp)
+static enum scsi_qc_status megaraid_queue_command_lck(struct scsi_cmnd *scp)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        adapter_t       *adapter;
        scb_t           *scb;
-       int             if_busy;
+       enum scsi_qc_status if_busy;
 
        adapter         = SCP2ADAPTER(scp);
        scp->result     = 0;
@@ -1477,7 +1479,8 @@ static DEF_SCSI_QCMD(megaraid_queue_command)
  * firmware. We also complete certain commands without sending them to firmware.
  */
 static scb_t *
-megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
+megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp,
+                       enum scsi_qc_status *busy)
 {
        mraid_device_t          *rdev = ADAP2RAIDDEV(adapter);
        int                     channel;
index abbbc4b36cd1d96faedb13a674ff729232278668..52894e892a923c7f889077fd1e653f7974cb3955 100644 (file)
@@ -1781,8 +1781,8 @@ out_return_cmd:
  * @shost:                     adapter SCSI host
  * @scmd:                      SCSI command to be queued
  */
-static int
-megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
+static enum scsi_qc_status megasas_queue_command(struct Scsi_Host *shost,
+                                                struct scsi_cmnd *scmd)
 {
        struct megasas_instance *instance;
        struct MR_PRIV_DEVICE *mr_device_priv_data;
index 768b85eecc8fdd1615b5f536e269a8170bf60a98..dc1402b321da49be4aee3e61abc0d5f64483f9e1 100644 (file)
@@ -1625,7 +1625,7 @@ static void cmd_complete(struct mesh_state *ms)
  * Called by midlayer with host locked to queue a new
  * request
  */
-static int mesh_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status mesh_queue_lck(struct scsi_cmnd *cmd)
 {
        struct mesh_state *ms;
 
index d4ca878d08869795f4ad2361005c83f969b5f044..7212459d5c4a1a74bb420e0374972a80ab76e0f6 100644 (file)
@@ -5029,8 +5029,8 @@ inline bool mpi3mr_allow_scmd_to_fw(struct scsi_cmnd *scmd)
  *         SCSI_MLQUEUE_DEVICE_BUSY when the device is busy.
  *         SCSI_MLQUEUE_HOST_BUSY when the host queue is full.
  */
-static int mpi3mr_qcmd(struct Scsi_Host *shost,
-       struct scsi_cmnd *scmd)
+static enum scsi_qc_status mpi3mr_qcmd(struct Scsi_Host *shost,
+                                      struct scsi_cmnd *scmd)
 {
        struct mpi3mr_ioc *mrioc = shost_priv(shost);
        struct mpi3mr_stgt_priv_data *stgt_priv_data;
index ac69a5abe2e2e5e91af5a80b0ae31f394d195b11..26a13b622c9593f2dbe4cbb0389302743998e107 100644 (file)
@@ -5422,8 +5422,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
  * SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or
  * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
  */
-static int
-scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
+static enum scsi_qc_status scsih_qcmd(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *scmd)
 {
        struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
        struct MPT3SAS_DEVICE *sas_device_priv_data;
index bdc2f2f17753179ca74af1214d31b9df9167ee3d..cda8bd083a38fee019e8b1cb2a2c3da3e7f2955b 100644 (file)
@@ -2077,8 +2077,8 @@ error:
  * @shost:                     Scsi host to queue command on
  * @scmd:                      SCSI command to be queued
  */
-static int mvumi_queue_command(struct Scsi_Host *shost,
-                                       struct scsi_cmnd *scmd)
+static enum scsi_qc_status mvumi_queue_command(struct Scsi_Host *shost,
+                                              struct scsi_cmnd *scmd)
 {
        struct mvumi_cmd *cmd;
        struct mvumi_hba *mhba;
index b8453c0333dc3787433324c0bd938f28c34e628b..efeacb9ffd7cf9448991d10f9e0bce3e477a0247 100644 (file)
@@ -1260,8 +1260,8 @@ static int myrb_host_reset(struct scsi_cmnd *scmd)
        return SUCCESS;
 }
 
-static int myrb_pthru_queuecommand(struct Scsi_Host *shost,
-               struct scsi_cmnd *scmd)
+static enum scsi_qc_status myrb_pthru_queuecommand(struct Scsi_Host *shost,
+                                                  struct scsi_cmnd *scmd)
 {
        struct request *rq = scsi_cmd_to_rq(scmd);
        struct myrb_hba *cb = shost_priv(shost);
@@ -1416,8 +1416,8 @@ static void myrb_read_capacity(struct myrb_hba *cb, struct scsi_cmnd *scmd,
        scsi_sg_copy_from_buffer(scmd, data, 8);
 }
 
-static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
-               struct scsi_cmnd *scmd)
+static enum scsi_qc_status myrb_ldev_queuecommand(struct Scsi_Host *shost,
+                                                 struct scsi_cmnd *scmd)
 {
        struct myrb_hba *cb = shost_priv(shost);
        struct myrb_cmdblk *cmd_blk = scsi_cmd_priv(scmd);
@@ -1603,8 +1603,8 @@ submit:
        return 0;
 }
 
-static int myrb_queuecommand(struct Scsi_Host *shost,
-               struct scsi_cmnd *scmd)
+static enum scsi_qc_status myrb_queuecommand(struct Scsi_Host *shost,
+                                            struct scsi_cmnd *scmd)
 {
        struct scsi_device *sdev = scmd->device;
 
index a58abd796603b05a3896289dfcca2d04e974c672..7e8bb533c669494849a2c328b9b9efbe4ef2c186 100644 (file)
@@ -1581,8 +1581,8 @@ static void myrs_mode_sense(struct myrs_hba *cs, struct scsi_cmnd *scmd,
        scsi_sg_copy_from_buffer(scmd, modes, mode_len);
 }
 
-static int myrs_queuecommand(struct Scsi_Host *shost,
-               struct scsi_cmnd *scmd)
+static enum scsi_qc_status myrs_queuecommand(struct Scsi_Host *shost,
+                                            struct scsi_cmnd *scmd)
 {
        struct request *rq = scsi_cmd_to_rq(scmd);
        struct myrs_hba *cs = shost_priv(shost);
index 34ba9b137789aa91050d61eeb99e774dad9b4820..4a255aafed80622bda03b6f1ee80fd51f732dd78 100644 (file)
@@ -7852,7 +7852,7 @@ static int ncr53c8xx_sdev_configure(struct scsi_device *device,
        return 0;
 }
 
-static int ncr53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status ncr53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
 {
      struct ncr_cmd_priv *cmd_priv = scsi_cmd_priv(cmd);
      void (*done)(struct scsi_cmnd *) = scsi_done;
index abc4ce9eae742d33d7272574a9cc4d31bafc6841..e893d56772417a21f1c7d3125cf35f2427791c58 100644 (file)
@@ -185,7 +185,8 @@ static void __exit exit_nsp32  (void);
 static int        nsp32_show_info   (struct seq_file *, struct Scsi_Host *);
 
 static int        nsp32_detect      (struct pci_dev *pdev);
-static int        nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+static enum scsi_qc_status nsp32_queuecommand(struct Scsi_Host *,
+                                             struct scsi_cmnd *);
 static const char *nsp32_info       (struct Scsi_Host *);
 static int        nsp32_release     (struct Scsi_Host *);
 
@@ -905,7 +906,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)
        return TRUE;
 }
 
-static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
index a5a1406a2bdef584e664ef41cdf5968bb55e105f..fb3a1b43d8bd5d2a7bebfc5cbefec74f15d8aa2c 100644 (file)
@@ -186,7 +186,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt)
        scsi_done(SCpnt);
 }
 
-static int nsp_queuecommand_lck(struct scsi_cmnd *const SCpnt)
+static enum scsi_qc_status nsp_queuecommand_lck(struct scsi_cmnd *const SCpnt)
 {
        struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt);
 #ifdef NSP_DEBUG
index e1ee8ef90ad3778fa21d94e3d56594e19db93ed3..12e58386bb8f890b080c93b94ae2826e6adb461d 100644 (file)
@@ -294,7 +294,8 @@ static struct Scsi_Host *nsp_detect     (struct scsi_host_template *sht);
 static const  char      *nsp_info       (struct Scsi_Host *shpnt);
 static        int        nsp_show_info  (struct seq_file *m,
                                         struct Scsi_Host *host);
-static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt);
+static enum scsi_qc_status nsp_queuecommand(struct Scsi_Host *h,
+                                           struct scsi_cmnd *SCpnt);
 
 /* Error handler */
 /*static int nsp_eh_abort       (struct scsi_cmnd *SCpnt);*/
index a3b505240351d00b97dc1e2bbce6a47b6373ac8f..8f56f7277dee1abdd9c8d22ab42cdd941532a8b1 100644 (file)
@@ -544,7 +544,7 @@ SYM53C500_info(struct Scsi_Host *SChost)
        return (info_msg);
 }
 
-static int SYM53C500_queue_lck(struct scsi_cmnd *SCpnt)
+static enum scsi_qc_status SYM53C500_queue_lck(struct scsi_cmnd *SCpnt)
 {
        struct sym53c500_cmd_priv *scp = scsi_cmd_priv(SCpnt);
        int i;
index 33f403e307ebfbd84079765d982ea963556dda0c..cf163e63054ba228d30b1eb67d7158d5e16fc555 100644 (file)
@@ -3242,14 +3242,14 @@ static int pmcraid_build_ioadl(
  *       SCSI_MLQUEUE_DEVICE_BUSY if device is busy
  *       SCSI_MLQUEUE_HOST_BUSY if host is busy
  */
-static int pmcraid_queuecommand_lck(struct scsi_cmnd *scsi_cmd)
+static enum scsi_qc_status pmcraid_queuecommand_lck(struct scsi_cmnd *scsi_cmd)
 {
        struct pmcraid_instance *pinstance;
        struct pmcraid_resource_entry *res;
        struct pmcraid_ioarcb *ioarcb;
+       enum scsi_qc_status rc = 0;
        struct pmcraid_cmd *cmd;
        u32 fw_version;
-       int rc = 0;
 
        pinstance =
                (struct pmcraid_instance *)scsi_cmd->device->host->hostdata;
index ea682f3044b619e1b03d9e6fcbcafd7098c9ac35..ddcef40789e5ad9be7fd553379b1a7ec506f1cc9 100644 (file)
@@ -816,7 +816,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
        return 0;
 }
 
-static int ppa_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status ppa_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        ppa_struct *dev = ppa_dev(cmd->device->host);
 
index 92fe5c5c5bb089b9030351234c2db442aa314a1d..a9c727d229313a93507e5a5e4bbe8c9952b1d000 100644 (file)
@@ -201,7 +201,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev,
        return 0;
 }
 
-static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status ps3rom_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        struct ps3rom_private *priv = shost_priv(cmd->device->host);
        struct ps3_storage_device *dev = priv->dev;
index 98afdfe63600314bdc73152fc1b81910ccb740b7..5b330a3203e12931d26bc1733e6b155853c733f6 100644 (file)
@@ -487,8 +487,8 @@ extern uint qedf_debug;
 
 extern struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf);
 extern void qedf_cmd_mgr_free(struct qedf_cmd_mgr *cmgr);
-extern int qedf_queuecommand(struct Scsi_Host *host,
-       struct scsi_cmnd *sc_cmd);
+extern enum scsi_qc_status qedf_queuecommand(struct Scsi_Host *host,
+                                            struct scsi_cmnd *sc_cmd);
 extern void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb);
 extern u8 *qedf_get_src_mac(struct fc_lport *lport);
 extern void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb);
index fcfc3bed02c61466381332145cdc0d95acc37316..d12c47be016e5b7d14ab73bbca22eca82784254d 100644 (file)
@@ -930,8 +930,8 @@ int qedf_post_io_req(struct qedf_rport *fcport, struct qedf_ioreq *io_req)
        return false;
 }
 
-int
-qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
+enum scsi_qc_status qedf_queuecommand(struct Scsi_Host *host,
+                                     struct scsi_cmnd *sc_cmd)
 {
        struct fc_lport *lport = shost_priv(host);
        struct qedf_ctx *qedf = lport_priv(lport);
index 26c312a48a19869debfbf63ef094818aad710584..cdd6fe002c324ceda54a83dbc1a4eb3d31fb8ab1 100644 (file)
@@ -406,9 +406,11 @@ static int qla1280_device_reset(struct scsi_qla_host *, int, int);
 static int qla1280_abort_command(struct scsi_qla_host *, struct srb *, int);
 static int qla1280_abort_isp(struct scsi_qla_host *);
 #ifdef QLA_64BIT_PTR
-static int qla1280_64bit_start_scsi(struct scsi_qla_host *, struct srb *);
+static enum scsi_qc_status qla1280_64bit_start_scsi(struct scsi_qla_host *,
+                                                   struct srb *);
 #else
-static int qla1280_32bit_start_scsi(struct scsi_qla_host *, struct srb *);
+static enum scsi_qc_status qla1280_32bit_start_scsi(struct scsi_qla_host *,
+                                                   struct srb *);
 #endif
 static void qla1280_nv_write(struct scsi_qla_host *, uint16_t);
 static void qla1280_poll(struct scsi_qla_host *);
@@ -682,12 +684,12 @@ qla1280_info(struct Scsi_Host *host)
  * handling).   Unfortunately, it sometimes calls the scheduler in interrupt
  * context which is a big NO! NO!.
  **************************************************************************/
-static int qla1280_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status qla1280_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        struct Scsi_Host *host = cmd->device->host;
        struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
        struct srb *sp = scsi_cmd_priv(cmd);
-       int status;
+       enum scsi_qc_status status;
 
        sp->cmd = cmd;
        sp->flags = 0;
@@ -2730,7 +2732,7 @@ qla1280_marker(struct scsi_qla_host *ha, int bus, int id, int lun, u8 type)
  *      0 = success, was able to issue command.
  */
 #ifdef QLA_64BIT_PTR
-static int
+static enum scsi_qc_status
 qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 {
        struct device_reg __iomem *reg = ha->iobase;
@@ -2738,7 +2740,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
        cmd_a64_entry_t *pkt;
        __le32 *dword_ptr;
        dma_addr_t dma_handle;
-       int status = 0;
+       enum scsi_qc_status status = 0;
        int cnt;
        int req_cnt;
        int seg_cnt;
@@ -2984,14 +2986,14 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
  * Returns:
  *      0 = success, was able to issue command.
  */
-static int
+static enum scsi_qc_status
 qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 {
        struct device_reg __iomem *reg = ha->iobase;
        struct scsi_cmnd *cmd = sp->cmd;
        struct cmd_entry *pkt;
        __le32 *dword_ptr;
-       int status = 0;
+       enum scsi_qc_status status = 0;
        int cnt;
        int req_cnt;
        int seg_cnt;
index fb0b689cbacd5d07f9941ee0f01f7769499fe782..08d2dcf6d7dab0d0e80917ef18e433ddb02f28d7 100644 (file)
@@ -402,8 +402,9 @@ static int qla2x00_mem_alloc(struct qla_hw_data *, uint16_t, uint16_t,
        struct req_que **, struct rsp_que **);
 static void qla2x00_free_fw_dump(struct qla_hw_data *);
 static void qla2x00_mem_free(struct qla_hw_data *);
-static int qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
-       struct qla_qpair *qpair);
+static enum scsi_qc_status qla2xxx_mqueuecommand(struct Scsi_Host *host,
+                                                struct scsi_cmnd *cmd,
+                                                struct qla_qpair *qpair);
 
 /* -------------------------------------------------------------------------- */
 static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req,
@@ -858,8 +859,8 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
                complete(comp);
 }
 
-static int
-qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
+static enum scsi_qc_status qla2xxx_queuecommand(struct Scsi_Host *host,
+                                               struct scsi_cmnd *cmd)
 {
        scsi_qla_host_t *vha = shost_priv(host);
        fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
@@ -981,9 +982,9 @@ qc24_fail_command:
 }
 
 /* For MQ supported I/O */
-static int
+static enum scsi_qc_status
 qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
-    struct qla_qpair *qpair)
+                     struct qla_qpair *qpair)
 {
        scsi_qla_host_t *vha = shost_priv(host);
        fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
index 97329c97332f830d5484d6b65c603d527b35bd27..71bb96ca33b40c2afe52819d2d2b8c1def8236b7 100644 (file)
@@ -155,7 +155,8 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len);
 /*
  * SCSI host template entry points
  */
-static int qla4xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd);
+static enum scsi_qc_status qla4xxx_queuecommand(struct Scsi_Host *h,
+                                               struct scsi_cmnd *cmd);
 static int qla4xxx_eh_abort(struct scsi_cmnd *cmd);
 static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd);
 static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd);
@@ -4107,7 +4108,8 @@ void qla4xxx_srb_compl(struct kref *ref)
  * completion handling). Unfortunately, it sometimes calls the scheduler
  * in interrupt context which is a big NO! NO!.
  **/
-static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
+static enum scsi_qc_status qla4xxx_queuecommand(struct Scsi_Host *host,
+                                               struct scsi_cmnd *cmd)
 {
        struct scsi_qla_host *ha = to_qla_host(host);
        struct ddb_entry *ddb_entry = cmd->device->hostdata;
index 1ce469b7db99f20b28b0308057b3be00f76574a1..d36293bc271731006075376030feea184cb5303c 100644 (file)
@@ -464,7 +464,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)
  *     Queued command
  */
 
-static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
index 83ef86c71f2f45c66b717dca464938db6dc5addd..a589c7656f57d3ca08cc86f65974f20817195acb 100644 (file)
@@ -104,7 +104,8 @@ struct qlogicfas408_priv {
 #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0])
 
 irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id);
-int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd);
+enum scsi_qc_status qlogicfas408_queuecommand(struct Scsi_Host *h,
+                                             struct scsi_cmnd *cmd);
 int qlogicfas408_biosparam(struct scsi_device * disk,
                           struct gendisk *unused,
                           sector_t capacity, int ip[]);
index c9984ef57f2638ec2f7f50943a3fe3173937ada6..ea0a2b5a0a4200488ffc68b46caf676b0253a6de 100644 (file)
@@ -1015,7 +1015,7 @@ static int qlogicpti_sdev_configure(struct scsi_device *sdev,
  *
  * "This code must fly." -davem
  */
-static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd)
+static enum scsi_qc_status qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct Scsi_Host *host = Cmnd->device->host;
index 9f17e9c49cb5d33f16f3a621fec9f2ca87f8d915..b8c1c77e9c78674a653ce8fc506e60f70006199e 100644 (file)
@@ -9284,8 +9284,9 @@ static void scsi_debug_abort_cmd(struct Scsi_Host *shost, struct scsi_cmnd *scp)
        set_host_byte(scp, res ? DID_OK : DID_ERROR);
 }
 
-static int scsi_debug_process_reserved_command(struct Scsi_Host *shost,
-                                              struct scsi_cmnd *scp)
+static enum scsi_qc_status
+scsi_debug_process_reserved_command(struct Scsi_Host *shost,
+                                   struct scsi_cmnd *scp)
 {
        struct sdebug_internal_cmd *internal_cmd = scsi_cmd_priv(scp);
 
@@ -9303,8 +9304,8 @@ static int scsi_debug_process_reserved_command(struct Scsi_Host *shost,
        return 0;
 }
 
-static int scsi_debug_queuecommand(struct Scsi_Host *shost,
-                                  struct scsi_cmnd *scp)
+static enum scsi_qc_status scsi_debug_queuecommand(struct Scsi_Host *shost,
+                                                  struct scsi_cmnd *scp)
 {
        u8 sdeb_i;
        struct scsi_device *sdp = scp->device;
index fe549e2b7c9407a820989518e0aa3508e1203fb7..36834768fec1cedd89c52892f2fc1d7a86021099 100644 (file)
@@ -6047,7 +6047,8 @@ static bool pqi_is_parity_write_stream(struct pqi_ctrl_info *ctrl_info,
        return false;
 }
 
-static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
+static enum scsi_qc_status pqi_scsi_queue_command(struct Scsi_Host *shost,
+                                                 struct scsi_cmnd *scmd)
 {
        int rc;
        struct pqi_ctrl_info *ctrl_info;
index 32f5a34b6987e39132a39932a4373c334bc50f49..ebaf6d63a59b1b76f3b8a17ff8a1477397dce03d 100644 (file)
@@ -362,7 +362,8 @@ void snic_glob_cleanup(void);
 extern struct workqueue_struct *snic_event_queue;
 extern const struct attribute_group *snic_host_groups[];
 
-int snic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+enum scsi_qc_status snic_queuecommand(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *sc);
 int snic_abort_cmd(struct scsi_cmnd *);
 int snic_device_reset(struct scsi_cmnd *);
 int snic_host_reset(struct scsi_cmnd *);
index 84973f0f771e200b901ab83d9808c0e11bc49d78..c6af3b8d252326ba6bcd9ba343ccd5c312ddbcc8 100644 (file)
@@ -315,8 +315,8 @@ issue_sc_end:
  * Routine to send a scsi cdb to LLD
  * Called with host_lock held and interrupts disabled
  */
-int
-snic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
+enum scsi_qc_status snic_queuecommand(struct Scsi_Host *shost,
+                                     struct scsi_cmnd *sc)
 {
        struct snic_tgt *tgt = NULL;
        struct snic *snic = shost_priv(shost);
index 93c223e0a777b881d9ee793b19f8715e885a2d99..5a3f6fe22ae94b6f80e9d6d9785d25e60fc3711f 100644 (file)
@@ -593,7 +593,7 @@ stex_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim)
        return 0;
 }
 
-static int stex_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status stex_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct st_hba *hba;
index 6e4112143c768998450c337fa9f03902febdbe45..19e18939d3a5f0155dd2030c0d8aa1f53c0bdeff 100644 (file)
@@ -1714,7 +1714,8 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
        return allowed;
 }
 
-static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
+static enum scsi_qc_status storvsc_queuecommand(struct Scsi_Host *host,
+                                               struct scsi_cmnd *scmnd)
 {
        int ret;
        struct hv_host_device *host_dev = shost_priv(host);
index 57637a81776d3d34fd6ad526fbed8908e073f4be..27e22acaf1a7e711091434c66f961acb06b26b2a 100644 (file)
@@ -485,7 +485,7 @@ void sym_log_bus_error(struct Scsi_Host *shost)
  * queuecommand method.  Entered with the host adapter lock held and
  * interrupts disabled.
  */
-static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
 {
        struct sym_hcb *np = SYM_SOFTC_PTR(cmd);
        struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd);
index 96a69edddbe5555574fc8fed1ba7c82a99df4472..6b1d8bcd06b9a57762efe75fcf9b98e1be6e97f4 100644 (file)
@@ -561,8 +561,8 @@ static struct virtio_scsi_vq *virtscsi_pick_vq_mq(struct virtio_scsi *vscsi,
        return &vscsi->req_vqs[hwq];
 }
 
-static int virtscsi_queuecommand(struct Scsi_Host *shost,
-                                struct scsi_cmnd *sc)
+static enum scsi_qc_status virtscsi_queuecommand(struct Scsi_Host *shost,
+                                                struct scsi_cmnd *sc)
 {
        struct virtio_scsi *vscsi = shost_priv(shost);
        struct virtio_scsi_vq *req_vq = virtscsi_pick_vq_mq(vscsi, sc);
index 32242d86cf5b633b6b47d01035780cb99894b6d4..11f86c76f391591c569876605acb3519dc1ffbda 100644 (file)
@@ -771,7 +771,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
        return 0;
 }
 
-static int pvscsi_queue_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status pvscsi_queue_lck(struct scsi_cmnd *cmd)
 {
        struct Scsi_Host *host = cmd->device->host;
        struct pvscsi_adapter *adapter = shost_priv(host);
index dd1fef9226f227b92b80acb862dbe4fd2406d3d2..1e49d0402f0b54fb7efa681aa895c5aee01d4d1d 100644 (file)
@@ -302,7 +302,7 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast,
        msg[1] = offset;
 }
 
-static int wd33c93_queuecommand_lck(struct scsi_cmnd *cmd)
+static enum scsi_qc_status wd33c93_queuecommand_lck(struct scsi_cmnd *cmd)
 {
        struct scsi_pointer *scsi_pointer = WD33C93_scsi_pointer(cmd);
        struct WD33C93_hostdata *hostdata;
index e5e4254b1477a7a0a9dfb368e9b86172d8c7fb9a..e1e98280aad1afd2a7544d9f9bcaae104c8ea076 100644 (file)
@@ -332,7 +332,8 @@ static inline struct scsi_pointer *WD33C93_scsi_pointer(struct scsi_cmnd *cmd)
 void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs,
          dma_setup_t setup, dma_stop_t stop, int clock_freq);
 int wd33c93_abort (struct scsi_cmnd *cmd);
-int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd);
+enum scsi_qc_status wd33c93_queuecommand(struct Scsi_Host *h,
+                                        struct scsi_cmnd *cmd);
 void wd33c93_intr (struct Scsi_Host *instance);
 int wd33c93_show_info(struct seq_file *, struct Scsi_Host *);
 int wd33c93_write_info(struct Scsi_Host *, char *, int);
index 0c99878287743a0308ab3fd469facaa9aa33b57d..830d40f57f6a47827147d4933d49a1efd9a03bd0 100644 (file)
@@ -204,7 +204,8 @@ static void wd719x_finish_cmd(struct wd719x_scb *scb, int result)
 }
 
 /* Build a SCB and send it to the card */
-static int wd719x_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
+static enum scsi_qc_status wd719x_queuecommand(struct Scsi_Host *sh,
+                                              struct scsi_cmnd *cmd)
 {
        int i, count_sg;
        unsigned long flags;
index 924025305753334b4f35b322a8a0bfa60dd88ffd..bf36c07c2b4728d2c71b27edfc4639bd0fb84a45 100644 (file)
@@ -603,8 +603,8 @@ static void scsifront_return(struct vscsifrnt_info *info)
        wake_up(&info->wq_pause);
 }
 
-static int scsifront_queuecommand(struct Scsi_Host *shost,
-                                 struct scsi_cmnd *sc)
+static enum scsi_qc_status scsifront_queuecommand(struct Scsi_Host *shost,
+                                                 struct scsi_cmnd *sc)
 {
        struct vscsifrnt_info *info = shost_priv(shost);
        struct vscsifrnt_shadow *shadow = scsi_cmd_priv(sc);
index 01a8e349dc4d1ab809935502d38f792f3dab23ef..0821a149573e7629bd766f95ab44711d87207b2e 100644 (file)
@@ -165,7 +165,8 @@ out_done:
  * ->queuecommand can be and usually is called from interrupt context, so
  * defer the actual submission to a workqueue.
  */
-static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
+static enum scsi_qc_status tcm_loop_queuecommand(struct Scsi_Host *sh,
+                                                struct scsi_cmnd *sc)
 {
        struct tcm_loop_cmd *tl_cmd = scsi_cmd_priv(sc);
 
index 057678f4c50a43ea82fcbeeb1d40980801dd9b8a..0369043ca010efb447290691b44101e38ff85fb8 100644 (file)
@@ -3033,7 +3033,8 @@ static int ufshcd_init_cmd_priv(struct Scsi_Host *host, struct scsi_cmnd *cmd)
  *
  * Return: 0 for success, non-zero in case of failure.
  */
-static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
+static enum scsi_qc_status ufshcd_queuecommand(struct Scsi_Host *host,
+                                              struct scsi_cmnd *cmd)
 {
        struct ufs_hba *hba = shost_priv(host);
        int tag = scsi_cmd_to_rq(cmd)->tag;
@@ -3113,8 +3114,8 @@ out:
        return err;
 }
 
-static int ufshcd_queue_reserved_command(struct Scsi_Host *host,
-                                        struct scsi_cmnd *cmd)
+static enum scsi_qc_status ufshcd_queue_reserved_command(struct Scsi_Host *host,
+                                                        struct scsi_cmnd *cmd)
 {
        struct ufshcd_lrb *lrbp = scsi_cmd_priv(cmd);
        struct request *rq = scsi_cmd_to_rq(cmd);
index 934ec5310fb977d35e6b4aa67ae76bb5e7253997..82859374f302695cd30c56dfa1e012e0ce211bec 100644 (file)
@@ -355,8 +355,8 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb)
        return result ? FAILED : SUCCESS;
 }
 
-static int
-mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb);
+static enum scsi_qc_status mts_scsi_queuecommand(struct Scsi_Host *shost,
+                                                struct scsi_cmnd *srb);
 
 static void mts_transfer_cleanup( struct urb *transfer );
 static void mts_do_sg(struct urb * transfer);
@@ -559,7 +559,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
        desc->context.data_pipe = pipe;
 }
 
-static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
+static enum scsi_qc_status mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
 {
        mts_scsi_cmnd_callback callback = scsi_done;
        struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
index d2f476e48d0c7283f12205b8828c3cb278f4a549..97de28e8556263009d94fefde7d30f1304c90415 100644 (file)
@@ -357,7 +357,7 @@ static int target_alloc(struct scsi_target *starget)
 
 /* queue a command */
 /* This is always called with scsi_lock(host) held */
-static int queuecommand_lck(struct scsi_cmnd *srb)
+static enum scsi_qc_status queuecommand_lck(struct scsi_cmnd *srb)
 {
        void (*done)(struct scsi_cmnd *) = scsi_done;
        struct us_data *us = host_to_us(srb->device->host);
index 73b1981cb1d5e0ffb8e2e6b0f2d83043c139e041..ac3c0b919fdddd927bff9bcf3be40b8bd5ac50d4 100644 (file)
@@ -636,7 +636,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
        return 0;
 }
 
-static int uas_queuecommand_lck(struct scsi_cmnd *cmnd)
+static enum scsi_qc_status uas_queuecommand_lck(struct scsi_cmnd *cmnd)
 {
        struct scsi_device *sdev = cmnd->device;
        struct uas_dev_info *devinfo = sdev->hostdata;
index 39534fafa36ae1d3259d14de63fee62961dafc7c..44117814d672951208bdf898fe1c5063d877f65f 100644 (file)
@@ -1150,7 +1150,8 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd,
 #else
 #define ATA_SCSI_COMPAT_IOCTL /* empty */
 #endif
-extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
+extern enum scsi_qc_status ata_scsi_queuecmd(struct Scsi_Host *h,
+                                            struct scsi_cmnd *cmd);
 #if IS_REACHABLE(CONFIG_ATA)
 bool ata_scsi_dma_need_drain(struct request *rq);
 #else
index 183d9fd50d2dd9658f42cf4b36021dc98c3b2fd8..be0ffe1e3395a4b510dd21091ba767e2306ad46c 100644 (file)
@@ -959,7 +959,8 @@ void fc_fcp_destroy(struct fc_lport *);
 /*
  * SCSI INTERACTION LAYER
  *****************************/
-int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+enum scsi_qc_status fc_queuecommand(struct Scsi_Host *shost,
+                                   struct scsi_cmnd *cmnd);
 int fc_eh_abort(struct scsi_cmnd *);
 int fc_eh_device_reset(struct scsi_cmnd *);
 int fc_eh_host_reset(struct scsi_cmnd *);
index 7282555adfd57aceaca1761a802eba42dcdf38d5..3d765c77bcd9c90fb5dcd1ad9e06f666699169a3 100644 (file)
@@ -392,7 +392,8 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);
 extern int iscsi_eh_recover_target(struct scsi_cmnd *sc);
 extern int iscsi_eh_session_reset(struct scsi_cmnd *sc);
 extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
-extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc);
+extern enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
+                                             struct scsi_cmnd *sc);
 extern enum scsi_timeout_action iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc);
 
 /*
index a0635b128d7abc196ea2138ad4f366f4bbd8fec8..e76f5744941be39bee30bf50ea5db45a0b295126 100644 (file)
@@ -689,7 +689,8 @@ extern void sas_suspend_ha(struct sas_ha_struct *sas_ha);
 
 int sas_phy_reset(struct sas_phy *phy, int hard_reset);
 int sas_phy_enable(struct sas_phy *phy, int enable);
-extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+extern enum scsi_qc_status sas_queuecommand(struct Scsi_Host *host,
+                                           struct scsi_cmnd *cmd);
 extern int sas_target_alloc(struct scsi_target *);
 int sas_sdev_configure(struct scsi_device *dev, struct queue_limits *lim);
 extern int sas_change_queue_depth(struct scsi_device *, int new_depth);
index e87cf7eadd268d51019635ac1404b64ed400b508..f6e12565a81de30871bed446b8454588109f57c4 100644 (file)
@@ -84,13 +84,15 @@ struct scsi_host_template {
         *
         * STATUS: REQUIRED
         */
-       int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
+       enum scsi_qc_status (*queuecommand)(struct Scsi_Host *,
+                                           struct scsi_cmnd *);
 
        /*
         * Queue a reserved command (BLK_MQ_REQ_RESERVED). The .queuecommand()
         * documentation also applies to the .queue_reserved_command() callback.
         */
-       int (*queue_reserved_command)(struct Scsi_Host *, struct scsi_cmnd *);
+       enum scsi_qc_status (*queue_reserved_command)(struct Scsi_Host *,
+                                                     struct scsi_cmnd *);
 
        /*
         * The commit_rqs function is used to trigger a hardware
@@ -525,10 +527,12 @@ struct scsi_host_template {
  *
  */
 #define DEF_SCSI_QCMD(func_name) \
-       int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd)   \
+       enum scsi_qc_status func_name(struct Scsi_Host *shost,          \
+                                     struct scsi_cmnd *cmd)            \
        {                                                               \
                unsigned long irq_flags;                                \
-               int rc;                                                 \
+               enum scsi_qc_status rc;                                 \
+                                                                       \
                spin_lock_irqsave(shost->host_lock, irq_flags);         \
                rc = func_name##_lck(cmd);                              \
                spin_unlock_irqrestore(shost->host_lock, irq_flags);    \