From 5d23bc00add34df55b2a55dcda1c38154c3d633c Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Tue, 29 Mar 2022 13:16:19 +0300 Subject: [PATCH] qla2x00t: Clean up set_bsg_result() function Move common code out of LINUX_VERSION_CODE statements. This patch does not change any functionality. --- qla2x00t/qla_bsg.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/qla2x00t/qla_bsg.c b/qla2x00t/qla_bsg.c index c8ff3432e..4053a7ba2 100644 --- a/qla2x00t/qla_bsg.c +++ b/qla2x00t/qla_bsg.c @@ -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