From 17f1770fab75a80f8c4d16d1955e01aedc791cad Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 29 Sep 2015 00:06:08 +0000 Subject: [PATCH] ib_srpt: Port to Linux kernel v4.3.0 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6520 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 6c9a9bbc0..9c65ae56b 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -4202,8 +4202,11 @@ static void srpt_add_one(struct ib_device *device) * in the system as service_id; therefore, the target_id will change * if this HCA is gone bad and replaced by different HCA */ - ret = ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid), 0, - NULL); + ret = ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid), 0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) + , NULL +#endif + ); if (ret) { pr_err("ib_cm_listen() failed: %d (cm_id state = %d)\n", ret, sdev->cm_id->state); @@ -4277,12 +4280,18 @@ err: /** * srpt_remove_one() - InfiniBand device removal callback function. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void srpt_remove_one(struct ib_device *device) { + void *client_data = ib_get_client_data(device, &srpt_client); +#else +static void srpt_remove_one(struct ib_device *device, void *client_data) +{ +#endif struct srpt_device *sdev; int i; - sdev = ib_get_client_data(device, &srpt_client); + sdev = client_data; if (!sdev) { pr_info("%s(%s): nothing to do.\n", __func__, device->name); return;