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

scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions

The DEF_SCSI_QCMD() macro passes the addresses of the SCSI host lock and
also that of the scsi_done function to the queuecommand_lck() function
implementations. Remove the 'scsi_done' argument since its address is
now a constant and instead call 'scsi_done' directly from inside the
queuecommand_lck() functions.

Link: https://lore.kernel.org/r/20211007204618.2196847-14-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
af049dfd 0feb3429

+75 -103
+2 -1
drivers/scsi/3w-9xxx.c
··· 1744 1744 } /* End twa_scsi_eh_reset() */ 1745 1745 1746 1746 /* This is the main scsi queue function to handle scsi opcodes */ 1747 - static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1747 + static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt) 1748 1748 { 1749 + void (*done)(struct scsi_cmnd *) = scsi_done; 1749 1750 int request_id, retval; 1750 1751 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; 1751 1752
+2 -1
drivers/scsi/3w-sas.c
··· 1450 1450 } /* End twl_scsi_eh_reset() */ 1451 1451 1452 1452 /* This is the main scsi queue function to handle scsi opcodes */ 1453 - static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1453 + static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt) 1454 1454 { 1455 + void (*done)(struct scsi_cmnd *) = scsi_done; 1455 1456 int request_id, retval; 1456 1457 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; 1457 1458
+2 -1
drivers/scsi/3w-xxxx.c
··· 1918 1918 } /* End tw_scsiop_test_unit_ready_complete() */ 1919 1919 1920 1920 /* This is the main scsi queue function to handle scsi opcodes */ 1921 - static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1921 + static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt) 1922 1922 { 1923 + void (*done)(struct scsi_cmnd *) = scsi_done; 1923 1924 unsigned char *command = SCpnt->cmnd; 1924 1925 int request_id = 0; 1925 1926 int retval = 1;
+1 -2
drivers/scsi/53c700.c
··· 1751 1751 return IRQ_RETVAL(handled); 1752 1752 } 1753 1753 1754 - static int 1755 - NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1754 + static int NCR_700_queuecommand_lck(struct scsi_cmnd *SCp) 1756 1755 { 1757 1756 struct NCR_700_Host_Parameters *hostdata = 1758 1757 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
+2 -2
drivers/scsi/BusLogic.c
··· 2866 2866 Outgoing Mailbox for execution by the associated Host Adapter. 2867 2867 */ 2868 2868 2869 - static int blogic_qcmd_lck(struct scsi_cmnd *command, 2870 - void (*comp_cb) (struct scsi_cmnd *)) 2869 + static int blogic_qcmd_lck(struct scsi_cmnd *command) 2871 2870 { 2871 + void (*comp_cb)(struct scsi_cmnd *) = scsi_done; 2872 2872 struct blogic_adapter *adapter = 2873 2873 (struct blogic_adapter *) command->device->host->hostdata; 2874 2874 struct blogic_tgt_flags *tgt_flags =
+1 -1
drivers/scsi/a100u2w.c
··· 911 911 * queue the command down to the controller 912 912 */ 913 913 914 - static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 914 + static int inia100_queue_lck(struct scsi_cmnd *cmd) 915 915 { 916 916 struct orc_scb *scb; 917 917 struct orc_host *host; /* Point to Host adapter control block */
+1 -2
drivers/scsi/advansys.c
··· 8453 8453 * This function always returns 0. Command return status is saved 8454 8454 * in the 'scp' result field. 8455 8455 */ 8456 - static int 8457 - advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 8456 + static int advansys_queuecommand_lck(struct scsi_cmnd *scp) 8458 8457 { 8459 8458 struct Scsi_Host *shost = scp->device->host; 8460 8459 int asc_res, result = 0;
+1 -3
drivers/scsi/aha152x.c
··· 975 975 * queue a command 976 976 * 977 977 */ 978 - static int aha152x_queue_lck(struct scsi_cmnd *SCpnt, 979 - void (*done)(struct scsi_cmnd *)) 978 + static int aha152x_queue_lck(struct scsi_cmnd *SCpnt) 980 979 { 981 - WARN_ON_ONCE(done != scsi_done); 982 980 return aha152x_internal_queue(SCpnt, NULL, 0); 983 981 } 984 982
+2 -2
drivers/scsi/aha1740.c
··· 315 315 return IRQ_RETVAL(handled); 316 316 } 317 317 318 - static int aha1740_queuecommand_lck(struct scsi_cmnd * SCpnt, 319 - void (*done)(struct scsi_cmnd *)) 318 + static int aha1740_queuecommand_lck(struct scsi_cmnd *SCpnt) 320 319 { 320 + void (*done)(struct scsi_cmnd *) = scsi_done; 321 321 unchar direction; 322 322 unchar *cmd = (unchar *) SCpnt->cmnd; 323 323 unchar target = scmd_id(SCpnt);
+1 -2
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 572 572 /* 573 573 * Queue an SCB to the controller. 574 574 */ 575 - static int 576 - ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 575 + static int ahd_linux_queue_lck(struct scsi_cmnd *cmd) 577 576 { 578 577 struct ahd_softc *ahd; 579 578 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
+1 -2
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 518 518 /* 519 519 * Queue an SCB to the controller. 520 520 */ 521 - static int 522 - ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 521 + static int ahc_linux_queue_lck(struct scsi_cmnd *cmd) 523 522 { 524 523 struct ahc_softc *ahc; 525 524 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
+1 -2
drivers/scsi/arcmsr/arcmsr_hba.c
··· 3231 3231 } 3232 3232 } 3233 3233 3234 - static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, 3235 - void (* done)(struct scsi_cmnd *)) 3234 + static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd) 3236 3235 { 3237 3236 struct Scsi_Host *host = cmd->device->host; 3238 3237 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+3 -11
drivers/scsi/arm/acornscsi.c
··· 2397 2397 */ 2398 2398 2399 2399 /* 2400 - * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 2400 + * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd) 2401 2401 * Purpose : queues a SCSI command 2402 2402 * Params : cmd - SCSI command 2403 - * done - function called on completion, with pointer to command descriptor 2404 2403 * Returns : 0, or < 0 on error. 2405 2404 */ 2406 - static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, 2407 - void (*done)(struct scsi_cmnd *)) 2405 + static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt) 2408 2406 { 2407 + void (*done)(struct scsi_cmnd *) = scsi_done; 2409 2408 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2410 - 2411 - if (!done) { 2412 - /* there should be some way of rejecting errors like this without panicing... */ 2413 - panic("scsi%d: queuecommand called with NULL done function [cmd=%p]", 2414 - host->host->host_no, SCpnt); 2415 - return -EINVAL; 2416 - } 2417 2409 2418 2410 #if (DEBUG & DEBUG_NO_WRITE) 2419 2411 if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) {
+4 -6
drivers/scsi/arm/fas216.c
··· 2233 2233 return result; 2234 2234 } 2235 2235 2236 - static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, 2237 - void (*done)(struct scsi_cmnd *)) 2236 + static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt) 2238 2237 { 2239 - return fas216_queue_command_internal(SCpnt, done); 2238 + return fas216_queue_command_internal(SCpnt, scsi_done); 2240 2239 } 2241 2240 2242 2241 DEF_SCSI_QCMD(fas216_queue_command) ··· 2263 2264 * Returns: scsi result code. 2264 2265 * Notes: io_request_lock is held, interrupts are disabled. 2265 2266 */ 2266 - static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, 2267 - void (*done)(struct scsi_cmnd *)) 2267 + static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt) 2268 2268 { 2269 2269 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2270 2270 ··· 2304 2306 2305 2307 spin_lock_irq(info->host->host_lock); 2306 2308 2307 - done(SCpnt); 2309 + scsi_done(SCpnt); 2308 2310 2309 2311 return 0; 2310 2312 }
+2 -2
drivers/scsi/atp870u.c
··· 618 618 * 619 619 * Queue a command to the ATP queue. Called with the host lock held. 620 620 */ 621 - static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, 622 - void (*done) (struct scsi_cmnd *)) 621 + static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p) 623 622 { 623 + void (*done)(struct scsi_cmnd *) = scsi_done; 624 624 unsigned char c; 625 625 unsigned int m; 626 626 struct atp_unit *dev;
+2 -2
drivers/scsi/bfa/bfad_im.c
··· 1199 1199 /* 1200 1200 * Scsi_Host template entry, queue a SCSI command to the BFAD. 1201 1201 */ 1202 - static int 1203 - bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 1202 + static int bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd) 1204 1203 { 1204 + void (*done)(struct scsi_cmnd *) = scsi_done; 1205 1205 struct bfad_im_port_s *im_port = 1206 1206 (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; 1207 1207 struct bfad_s *bfad = im_port->bfad;
+2 -1
drivers/scsi/dc395x.c
··· 960 960 * and is expected to be held on return. 961 961 * 962 962 **/ 963 - static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 963 + static int dc395x_queue_command_lck(struct scsi_cmnd *cmd) 964 964 { 965 + void (*done)(struct scsi_cmnd *) = scsi_done; 965 966 struct DeviceCtlBlk *dcb; 966 967 struct ScsiReqBlk *srb; 967 968 struct AdapterCtlBlk *acb =
+1 -1
drivers/scsi/dpt_i2o.c
··· 416 416 return 0; 417 417 } 418 418 419 - static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 419 + static int adpt_queue_lck(struct scsi_cmnd *cmd) 420 420 { 421 421 adpt_hba* pHba = NULL; 422 422 struct adpt_device* pDev = NULL; /* dpt per device information */
+1 -1
drivers/scsi/esp_scsi.c
··· 952 952 scsi_track_queue_full(dev, lp->num_tagged - 1); 953 953 } 954 954 955 - static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 955 + static int esp_queuecommand_lck(struct scsi_cmnd *cmd) 956 956 { 957 957 struct scsi_device *dev = cmd->device; 958 958 struct esp *esp = shost_priv(dev->host);
+2 -1
drivers/scsi/fnic/fnic_scsi.c
··· 420 420 * Routine to send a scsi cdb 421 421 * Called with host_lock held and interrupts disabled. 422 422 */ 423 - static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 423 + static int fnic_queuecommand_lck(struct scsi_cmnd *sc) 424 424 { 425 + void (*done)(struct scsi_cmnd *) = scsi_done; 425 426 const int tag = scsi_cmd_to_rq(sc)->tag; 426 427 struct fc_lport *lp = shost_priv(sc->device->host); 427 428 struct fc_rport *rport;
+1 -2
drivers/scsi/hptiop.c
··· 993 993 return 0; 994 994 } 995 995 996 - static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, 997 - void (*done)(struct scsi_cmnd *)) 996 + static int hptiop_queuecommand_lck(struct scsi_cmnd *scp) 998 997 { 999 998 struct Scsi_Host *host = scp->device->host; 1000 999 struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata;
+2 -2
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 1039 1039 * @cmnd: struct scsi_cmnd to be executed 1040 1040 * @done: Callback function to be called when cmd is completed 1041 1041 */ 1042 - static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, 1043 - void (*done) (struct scsi_cmnd *)) 1042 + static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd) 1044 1043 { 1044 + void (*done)(struct scsi_cmnd *) = scsi_done; 1045 1045 struct srp_cmd *srp_cmd; 1046 1046 struct srp_event_struct *evt_struct; 1047 1047 struct srp_indirect_buf *indirect;
+1 -2
drivers/scsi/imm.c
··· 910 910 return 0; 911 911 } 912 912 913 - static int imm_queuecommand_lck(struct scsi_cmnd *cmd, 914 - void (*done)(struct scsi_cmnd *)) 913 + static int imm_queuecommand_lck(struct scsi_cmnd *cmd) 915 914 { 916 915 imm_struct *dev = imm_dev(cmd->device->host); 917 916
+1 -2
drivers/scsi/initio.c
··· 2609 2609 * will cause the mid layer to call us again later with the command) 2610 2610 */ 2611 2611 2612 - static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, 2613 - void (*done)(struct scsi_cmnd *)) 2612 + static int i91u_queuecommand_lck(struct scsi_cmnd *cmd) 2614 2613 { 2615 2614 struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; 2616 2615 struct scsi_ctrl_blk *cmnd;
+2 -1
drivers/scsi/ips.c
··· 1035 1035 /* Linux obtains io_request_lock before calling this function */ 1036 1036 /* */ 1037 1037 /****************************************************************************/ 1038 - static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) 1038 + static int ips_queue_lck(struct scsi_cmnd *SC) 1039 1039 { 1040 + void (*done)(struct scsi_cmnd *) = scsi_done; 1040 1041 ips_ha_t *ha; 1041 1042 ips_passthru_t *pt; 1042 1043
+1 -2
drivers/scsi/mac53c94.c
··· 66 66 static void cmd_done(struct fsc_state *, int result); 67 67 static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); 68 68 69 - 70 - static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 69 + static int mac53c94_queue_lck(struct scsi_cmnd *cmd) 71 70 { 72 71 struct fsc_state *state; 73 72
+1 -2
drivers/scsi/megaraid.c
··· 370 370 * 371 371 * The command queuing entry point for the mid-layer. 372 372 */ 373 - static int 374 - megaraid_queue_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) 373 + static int megaraid_queue_lck(struct scsi_cmnd *scmd) 375 374 { 376 375 adapter_t *adapter; 377 376 scb_t *scb;
+2 -2
drivers/scsi/megaraid/megaraid_mbox.c
··· 1432 1432 * 1433 1433 * Queue entry point for mailbox based controllers. 1434 1434 */ 1435 - static int 1436 - megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1435 + static int megaraid_queue_command_lck(struct scsi_cmnd *scp) 1437 1436 { 1437 + void (*done)(struct scsi_cmnd *) = scsi_done; 1438 1438 adapter_t *adapter; 1439 1439 scb_t *scb; 1440 1440 int if_busy;
+1 -1
drivers/scsi/mesh.c
··· 1621 1621 * Called by midlayer with host locked to queue a new 1622 1622 * request 1623 1623 */ 1624 - static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1624 + static int mesh_queue_lck(struct scsi_cmnd *cmd) 1625 1625 { 1626 1626 struct mesh_state *ms; 1627 1627
+2 -1
drivers/scsi/ncr53c8xx.c
··· 7852 7852 return 0; 7853 7853 } 7854 7854 7855 - static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 7855 + static int ncr53c8xx_queue_command_lck(struct scsi_cmnd *cmd) 7856 7856 { 7857 + void (*done)(struct scsi_cmnd *) = scsi_done; 7857 7858 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; 7858 7859 unsigned long flags; 7859 7860 int sts;
+2 -2
drivers/scsi/nsp32.c
··· 904 904 return TRUE; 905 905 } 906 906 907 - static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, 908 - void (*done)(struct scsi_cmnd *)) 907 + static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt) 909 908 { 909 + void (*done)(struct scsi_cmnd *) = scsi_done; 910 910 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; 911 911 nsp32_target *target; 912 912 nsp32_lunt *cur_lunt;
+1 -2
drivers/scsi/pcmcia/nsp_cs.c
··· 181 181 scsi_done(SCpnt); 182 182 } 183 183 184 - static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, 185 - void (*done)(struct scsi_cmnd *)) 184 + static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt) 186 185 { 187 186 #ifdef NSP_DEBUG 188 187 /*unsigned int host_id = SCpnt->device->host->this_id;*/
+1 -2
drivers/scsi/pcmcia/sym53c500_cs.c
··· 537 537 return (info_msg); 538 538 } 539 539 540 - static int 541 - SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 540 + static int SYM53C500_queue_lck(struct scsi_cmnd *SCpnt) 542 541 { 543 542 int i; 544 543 int port_base = SCpnt->device->host->io_port;
+1 -4
drivers/scsi/pmcraid.c
··· 3313 3313 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 3314 3314 * SCSI_MLQUEUE_HOST_BUSY if host is busy 3315 3315 */ 3316 - static int pmcraid_queuecommand_lck( 3317 - struct scsi_cmnd *scsi_cmd, 3318 - void (*done) (struct scsi_cmnd *) 3319 - ) 3316 + static int pmcraid_queuecommand_lck(struct scsi_cmnd *scsi_cmd) 3320 3317 { 3321 3318 struct pmcraid_instance *pinstance; 3322 3319 struct pmcraid_resource_entry *res;
+1 -2
drivers/scsi/ppa.c
··· 786 786 return 0; 787 787 } 788 788 789 - static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, 790 - void (*done) (struct scsi_cmnd *)) 789 + static int ppa_queuecommand_lck(struct scsi_cmnd *cmd) 791 790 { 792 791 ppa_struct *dev = ppa_dev(cmd->device->host); 793 792
+1 -2
drivers/scsi/ps3rom.c
··· 200 200 return 0; 201 201 } 202 202 203 - static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, 204 - void (*done)(struct scsi_cmnd *)) 203 + static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd) 205 204 { 206 205 struct ps3rom_private *priv = shost_priv(cmd->device->host); 207 206 struct ps3_storage_device *dev = priv->dev;
+1 -2
drivers/scsi/qla1280.c
··· 689 689 * handling). Unfortunately, it sometimes calls the scheduler in interrupt 690 690 * context which is a big NO! NO!. 691 691 **************************************************************************/ 692 - static int 693 - qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 692 + static int qla1280_queuecommand_lck(struct scsi_cmnd *cmd) 694 693 { 695 694 struct Scsi_Host *host = cmd->device->host; 696 695 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
+2 -2
drivers/scsi/qlogicfas408.c
··· 460 460 * Queued command 461 461 */ 462 462 463 - static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, 464 - void (*done) (struct scsi_cmnd *)) 463 + static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd) 465 464 { 465 + void (*done)(struct scsi_cmnd *) = scsi_done; 466 466 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); 467 467 468 468 set_host_byte(cmd, DID_OK);
+2 -1
drivers/scsi/qlogicpti.c
··· 1013 1013 * 1014 1014 * "This code must fly." -davem 1015 1015 */ 1016 - static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) 1016 + static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd) 1017 1017 { 1018 + void (*done)(struct scsi_cmnd *) = scsi_done; 1018 1019 struct Scsi_Host *host = Cmnd->device->host; 1019 1020 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; 1020 1021 struct Command_Entry *cmd;
+2 -2
drivers/scsi/stex.c
··· 590 590 return 0; 591 591 } 592 592 593 - static int 594 - stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 593 + static int stex_queuecommand_lck(struct scsi_cmnd *cmd) 595 594 { 595 + void (*done)(struct scsi_cmnd *) = scsi_done; 596 596 struct st_hba *hba; 597 597 struct Scsi_Host *host; 598 598 unsigned int id, lun;
+1 -2
drivers/scsi/sym53c8xx_2/sym_glue.c
··· 486 486 * queuecommand method. Entered with the host adapter lock held and 487 487 * interrupts disabled. 488 488 */ 489 - static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, 490 - void (*done)(struct scsi_cmnd *)) 489 + static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd) 491 490 { 492 491 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); 493 492 struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd);
+1 -1
drivers/scsi/vmw_pvscsi.c
··· 768 768 return 0; 769 769 } 770 770 771 - static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 771 + static int pvscsi_queue_lck(struct scsi_cmnd *cmd) 772 772 { 773 773 struct Scsi_Host *host = cmd->device->host; 774 774 struct pvscsi_adapter *adapter = shost_priv(host);
+1 -3
drivers/scsi/wd33c93.c
··· 362 362 msg[1] = offset; 363 363 } 364 364 365 - static int 366 - wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, 367 - void (*done)(struct scsi_cmnd *)) 365 + static int wd33c93_queuecommand_lck(struct scsi_cmnd *cmd) 368 366 { 369 367 struct WD33C93_hostdata *hostdata; 370 368 struct scsi_cmnd *tmp;
+2 -2
drivers/staging/rts5208/rtsx.c
··· 118 118 119 119 /* queue a command */ 120 120 /* This is always called with scsi_lock(host) held */ 121 - static int queuecommand_lck(struct scsi_cmnd *srb, 122 - void (*done)(struct scsi_cmnd *)) 121 + static int queuecommand_lck(struct scsi_cmnd *srb) 123 122 { 123 + void (*done)(struct scsi_cmnd *) = scsi_done; 124 124 struct rtsx_dev *dev = host_to_rtsx(srb->device->host); 125 125 struct rtsx_chip *chip = dev->chip; 126 126
+2 -3
drivers/staging/unisys/visorhba/visorhba_main.c
··· 446 446 * Return: 0 if successfully queued to the Service Partition, otherwise 447 447 * error code 448 448 */ 449 - static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd, 450 - void (*visorhba_cmnd_done) 451 - (struct scsi_cmnd *)) 449 + static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd) 452 450 { 451 + void (*visorhba_cmnd_done)(struct scsi_cmnd *) = scsi_done; 453 452 struct uiscmdrsp *cmdrsp; 454 453 struct scsi_device *scsidev = scsicmd->device; 455 454 int insert_location;
+2 -3
drivers/usb/image/microtek.c
··· 561 561 desc->context.data_pipe = pipe; 562 562 } 563 563 564 - 565 - static int 566 - mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 564 + static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb) 567 565 { 566 + mts_scsi_cmnd_callback callback = scsi_done; 568 567 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); 569 568 int res; 570 569
+2 -2
drivers/usb/storage/scsiglue.c
··· 363 363 364 364 /* queue a command */ 365 365 /* This is always called with scsi_lock(host) held */ 366 - static int queuecommand_lck(struct scsi_cmnd *srb, 367 - void (*done)(struct scsi_cmnd *)) 366 + static int queuecommand_lck(struct scsi_cmnd *srb) 368 367 { 368 + void (*done)(struct scsi_cmnd *) = scsi_done; 369 369 struct us_data *us = host_to_us(srb->device->host); 370 370 371 371 /* check for state-transition errors */
+1 -2
drivers/usb/storage/uas.c
··· 633 633 return 0; 634 634 } 635 635 636 - static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, 637 - void (*done)(struct scsi_cmnd *)) 636 + static int uas_queuecommand_lck(struct scsi_cmnd *cmnd) 638 637 { 639 638 struct scsi_device *sdev = cmnd->device; 640 639 struct uas_dev_info *devinfo = sdev->hostdata;
+1 -1
include/scsi/scsi_host.h
··· 516 516 unsigned long irq_flags; \ 517 517 int rc; \ 518 518 spin_lock_irqsave(shost->host_lock, irq_flags); \ 519 - rc = func_name##_lck(cmd, scsi_done); \ 519 + rc = func_name##_lck(cmd); \ 520 520 spin_unlock_irqrestore(shost->host_lock, irq_flags); \ 521 521 return rc; \ 522 522 }