From 8730c9c5a688b74460ef5cc675b294d424d37f44 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 Apr 2017 20:46:50 +0000 Subject: [PATCH 1/3] ib_srpt: Fix two configuration tests git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7129 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/conftest/ib_client_remove/ib_client_remove.c | 6 +++--- srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/srpt/conftest/ib_client_remove/ib_client_remove.c b/srpt/conftest/ib_client_remove/ib_client_remove.c index 77cac3525..67f903d66 100644 --- a/srpt/conftest/ib_client_remove/ib_client_remove.c +++ b/srpt/conftest/ib_client_remove/ib_client_remove.c @@ -1,15 +1,15 @@ #include #include -static void client_remove(struct ib_device *dev, void *client_data) +static void remove_one(struct ib_device *device, void *client_data) { } static int modinit(void) { - struct ib_client c = { .remove = client_remove }; + struct ib_client c = { .remove = remove_one }; - return (uintptr_t)c.remove; + return c.remove != NULL; } module_init(modinit); diff --git a/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c b/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c index 2aeb8bbf2..7810f9ff7 100644 --- a/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c +++ b/srpt/conftest/ib_dma_map_ops/ib_dma_map_ops.c @@ -1,11 +1,9 @@ #include #include -static struct ib_device *dev; - static int modinit(void) { - return dev->dma_ops != NULL; + return ib_dma_mapping_error(NULL, 0) != 0; } module_init(modinit); From 41964012c14b76c89b34d851856365cc6bc92180 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 Apr 2017 20:47:26 +0000 Subject: [PATCH 2/3] isert-scst: Fix two configuration tests git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7130 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/conftest/ib_client_remove/ib_client_remove.c | 6 +++--- iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c b/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c index 77cac3525..67f903d66 100644 --- a/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c +++ b/iscsi-scst/conftest/ib_client_remove/ib_client_remove.c @@ -1,15 +1,15 @@ #include #include -static void client_remove(struct ib_device *dev, void *client_data) +static void remove_one(struct ib_device *device, void *client_data) { } static int modinit(void) { - struct ib_client c = { .remove = client_remove }; + struct ib_client c = { .remove = remove_one }; - return (uintptr_t)c.remove; + return c.remove != NULL; } module_init(modinit); diff --git a/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c b/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c index 2aeb8bbf2..7810f9ff7 100644 --- a/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c +++ b/iscsi-scst/conftest/ib_dma_map_ops/ib_dma_map_ops.c @@ -1,11 +1,9 @@ #include #include -static struct ib_device *dev; - static int modinit(void) { - return dev->dma_ops != NULL; + return ib_dma_mapping_error(NULL, 0) != 0; } module_init(modinit); From 8c4889d092aed023ee9a3ef163c2a3a01d2636ad Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 Apr 2017 21:38:56 +0000 Subject: [PATCH 3/3] iscsi-scst/Makefile: Fix detection of whether InfiniBand is enabled Inspecting modules.symbols is fine after a kernel has been installed but not if a kernel tree has not been installed. If a kernel tree has not been installed, check the .config file. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7131 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 5a83d7516..9827cac51 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -55,7 +55,7 @@ ifeq ($(INSTALL_MOD_PATH),) endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -INFINIBAND_ENABLED = $(shell if grep -wq 'ib_register_client' $$(dirname "$(KDIR)")/modules.symbols; then echo true; else echo false; fi) +INFINIBAND_ENABLED = $(shell syms=$$(dirname "$(KDIR)")/modules.symbols; if [ -e "$$syms" ] && grep -wq 'ib_register_client' "$$syms" || grep -q "^CONFIG_INFINIBAND=[my]$$" "$(KDIR)/.config"; then echo true; else echo false; fi) all: progs mods