mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
scst: Change the return type of the .queuecommand() callback
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.
This commit is contained in:
@@ -445,8 +445,15 @@ 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 *);
|
||||
int qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
|
||||
struct qla_qpair *qpair);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int qla2xxx_mqueuecommand(struct Scsi_Host *host,
|
||||
struct scsi_cmnd *cmd,
|
||||
struct qla_qpair *qpair);
|
||||
#else
|
||||
static enum scsi_qc_status qla2xxx_mqueuecommand(struct Scsi_Host *host,
|
||||
struct scsi_cmnd *cmd,
|
||||
struct qla_qpair *qpair);
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req,
|
||||
@@ -901,8 +908,13 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
|
||||
complete(comp);
|
||||
}
|
||||
|
||||
static int
|
||||
qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int qla2xxx_queuecommand(struct Scsi_Host *host,
|
||||
struct scsi_cmnd *cmd)
|
||||
#else
|
||||
static enum scsi_qc_status qla2xxx_queuecommand(struct Scsi_Host *host,
|
||||
struct scsi_cmnd *cmd)
|
||||
#endif
|
||||
{
|
||||
scsi_qla_host_t *vha = shost_priv(host);
|
||||
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
|
||||
@@ -1026,9 +1038,15 @@ qc24_fail_command:
|
||||
}
|
||||
|
||||
/* For MQ supported I/O */
|
||||
int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int
|
||||
qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
|
||||
struct qla_qpair *qpair)
|
||||
struct qla_qpair *qpair)
|
||||
#else
|
||||
static enum scsi_qc_status
|
||||
qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
|
||||
struct qla_qpair *qpair)
|
||||
#endif
|
||||
{
|
||||
scsi_qla_host_t *vha = shost_priv(host);
|
||||
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
|
||||
|
||||
@@ -257,10 +257,11 @@ static void qla2xxx_sdev_destroy(struct scsi_device *sdev);
|
||||
static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time);
|
||||
static void qla2xxx_scan_start(struct Scsi_Host *);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd,
|
||||
void (*fn)(struct scsi_cmnd *));
|
||||
#else
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd);
|
||||
#else
|
||||
static enum scsi_qc_status qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd);
|
||||
#endif
|
||||
static DEF_SCSI_QCMD(qla2xxx_queuecommand);
|
||||
static int qla2xxx_eh_abort(struct scsi_cmnd *);
|
||||
@@ -690,10 +691,11 @@ qla2x00_sp_compl(void *data, void *ptr, int res)
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||
static int
|
||||
qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd);
|
||||
#else
|
||||
static int qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd)
|
||||
static enum scsi_qc_status qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd)
|
||||
#endif
|
||||
{
|
||||
scsi_qla_host_t *vha = shost_priv(cmd->device->host);
|
||||
|
||||
@@ -839,8 +839,11 @@ static int scst_local_send_resp(struct scsi_cmnd *cmnd,
|
||||
* This does the heavy lifting ... we pass all the commands on to the
|
||||
* target driver and have it do its magic ...
|
||||
*/
|
||||
static int scst_local_queuecommand(struct Scsi_Host *host,
|
||||
struct scsi_cmnd *scmd)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(7, 0, 0)
|
||||
static int scst_local_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmd)
|
||||
#else
|
||||
static enum scsi_qc_status scst_local_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmd)
|
||||
#endif
|
||||
{
|
||||
struct scst_local_sess *sess;
|
||||
struct scatterlist *sgl = NULL;
|
||||
|
||||
Reference in New Issue
Block a user