From ae0037f88c069af0ccf23ccb9ee9ee4cd65a2589 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:14:12 +0000 Subject: [PATCH] ib_srpt: Fix the build against kernel version v2.6.30 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7882 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index bfc552285..d4d5f1e53 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -156,7 +156,11 @@ module_param(use_node_guid_in_target_name, bool, 0444); MODULE_PARM_DESC(use_node_guid_in_target_name, "Use HCA node GUID as SCST target name."); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +static int srpt_get_u64_x(char *buffer, struct kernel_param *kp) +#else static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp) +#endif { return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg); } @@ -1094,6 +1098,7 @@ static int srpt_zerolength_write(struct srpt_rdma_ch *ch) static inline void *srpt_get_desc_buf(struct srp_cmd *srp_cmd) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) /* * The pointer computations below will only be compiled correctly * if srp_cmd::add_data is declared as s8*, u8*, s8[] or u8[], so check @@ -1101,6 +1106,7 @@ static inline void *srpt_get_desc_buf(struct srp_cmd *srp_cmd) */ BUILD_BUG_ON(!__same_type(srp_cmd->add_data[0], (s8)0) && !__same_type(srp_cmd->add_data[0], (u8)0)); +#endif /* * According to the SRP spec, the lower two bits of the 'ADDITIONAL