qla2x00t: Clean up set_bsg_result() function

Move common code out of LINUX_VERSION_CODE statements.

This patch does not change any functionality.
This commit is contained in:
Gleb Chesnokov
2022-03-29 13:16:19 +03:00
parent 5e9f44d7ce
commit 5d23bc00ad

View File

@@ -20,21 +20,17 @@ static inline void set_bsg_result(struct fc_bsg_job *job, int result)
{
job->req->errors = result;
}
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
static inline void set_bsg_result(struct bsg_job *job, int result)
{
job->req->errors = result;
}
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \
!defined(CONFIG_SUSE_KERNEL)
static inline void set_bsg_result(struct bsg_job *job, int result)
{
scsi_req(job->req)->result = result;
}
#else
static inline void set_bsg_result(struct bsg_job *job, int result)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
job->req->errors = result;
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \
!defined(CONFIG_SUSE_KERNEL)
scsi_req(job->req)->result = result;
#else
scsi_req(blk_mq_rq_from_pdu(job))->result = result;
#endif
}
#endif