Re: [PATCH v2 28/84] dc395x: Call scsi_done() directly

Bart Van Assche
2021-09-30T16:04:57Z

On 9/30/21 3:26 AM, Oliver Neukum wrote:
> On 30.09.21 00:05, Bart Van Assche wrote:
>> Conditional statements are faster than indirect calls. Hence call
>> scsi_done() directly.
>
> as you are doing this to multiple drivers, is there really a need to
> pass the the function pointer at all?

Hi Oliver,

Thanks for having taken a look. I think the 'done' argument of the queue_command_lck()
functions is already superfluous today. The definition of the DEF_SCSI_QCMD() function
is as follows (without this patch series applied):

#define DEF_SCSI_QCMD(func_name) \
int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \
{ \
unsigned long irq_flags; \
int rc; \
spin_lock_irqsave(shost->host_lock, irq_flags); \
rc = func_name##_lck (cmd, cmd->scsi_done); \
spin_unlock_irqrestore(shost->host_lock, irq_flags); \
return rc; \
}

In other words, the 'done' argument can be derived easily from the SCSI command pointer.
Do you want me to include a patch in this series that removes the 'done' argument from
the queue_command_lck() functions?

Thanks,

Bart.