diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-07 22:46:14 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-17 03:32:16 +0200 |
commit | af049dfd0b105bab32170d1c68826a4cd8424efd (patch) | |
tree | cd01a048a3b5c556c51d5dcd8b1e54f1e4b5b342 /drivers/scsi/arm | |
parent | scsi: fas216: Introduce the function fas216_queue_command_internal() (diff) | |
download | linux-af049dfd0b105bab32170d1c68826a4cd8424efd.tar.xz linux-af049dfd0b105bab32170d1c68826a4cd8424efd.zip |
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>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r-- | drivers/scsi/arm/acornscsi.c | 14 | ||||
-rw-r--r-- | drivers/scsi/arm/fas216.c | 10 |
2 files changed, 7 insertions, 17 deletions
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index dadaf5ee0ea9..81eb3bbdfc51 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -2397,24 +2397,16 @@ acornscsi_intr(int irq, void *dev_id) */ /* - * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) + * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd) * Purpose : queues a SCSI command * Params : cmd - SCSI command - * done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, - void (*done)(struct scsi_cmnd *)) +static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt) { + void (*done)(struct scsi_cmnd *) = scsi_done; AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; - if (!done) { - /* there should be some way of rejecting errors like this without panicing... */ - panic("scsi%d: queuecommand called with NULL done function [cmd=%p]", - host->host->host_no, SCpnt); - return -EINVAL; - } - #if (DEBUG & DEBUG_NO_WRITE) if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) { printk(KERN_CRIT "scsi%d.%c: WRITE attempted with NO_WRITE flag set\n", diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index a8befd2eec52..7019b91f0ce6 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2233,10 +2233,9 @@ static int fas216_queue_command_internal(struct scsi_cmnd *SCpnt, return result; } -static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, - void (*done)(struct scsi_cmnd *)) +static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt) { - return fas216_queue_command_internal(SCpnt, done); + return fas216_queue_command_internal(SCpnt, scsi_done); } DEF_SCSI_QCMD(fas216_queue_command) @@ -2264,8 +2263,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, - void (*done)(struct scsi_cmnd *)) +static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt) { FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; @@ -2306,7 +2304,7 @@ static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, spin_lock_irq(info->host->host_lock); - done(SCpnt); + scsi_done(SCpnt); return 0; } |