Skip to contentSkip to conversation

RDMA/umem: Avoid partial declaration of non-static function

PATCH Applied Leon Romanovsky 2 participants 2 messages Oct 25, 2017 – Nov 10, 2017 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/umem: Avoid partial declaration of non-static function

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The RDMA/umem uses generic RB-trees macros to generate various ib_umem access functions. The generation is performed with INTERVAL_TREE_DEFINE macro, which allows one of two modes: declare all functions as static or declare none of the function to be static.

The second mode of operation produces the following sparse errors:
drivers/infiniband/core/umem_rbtree.c:69:1:
warning: symbol 'rbt_ib_umem_iter_first' was not declared. Should it be static?
drivers/infiniband/core/umem_rbtree.c:69:1:
warning: symbol 'rbt_ib_umem_iter_next' was not declared. Should it be static?

Code relocation together with declaration of such functions to be "static" solves the issue.

Because there is no need to have separate file for two functions, let's consolidate umem_rtree.c and umem_odp.c into one file.

---
 drivers/infiniband/core/Makefile      |   2 +-
 drivers/infiniband/core/umem_odp.c    |  72 ++++++++++++++++++++++
 drivers/infiniband/core/umem_rbtree.c | 109 ----------------------------------
 include/rdma/ib_umem_odp.h            |   4 --
 4 files changed, 73 insertions(+), 114 deletions(-)
 delete mode 100644 drivers/infiniband/core/umem_rbtree.c
drivers/infiniband/core/Makefile +1 -1
index b4df164f71a6..336ace50b0ab 100644
@@ -14,7 +14,7 @@ ib_core-y :=			packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \
 				security.o nldev.o
 
 ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o
-ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o
+ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o
 ib_core-$(CONFIG_CGROUP_RDMA) += cgroup.o
 
 ib_cm-y :=			cm.o
drivers/infiniband/core/umem_odp.c +72 -0

86 lines not on this page · raw message

drivers/infiniband/core/umem_rbtree.c deleted +0 -109

109 lines not on this page · raw message

include/rdma/ib_umem_odp.h +0 -4
index 5eb7f5bc8248..6a17f856f841 100644
@@ -111,10 +111,6 @@ int ib_umem_odp_map_dma_pages(struct ib_umem *umem, u64 start_offset, u64 bcnt,
 void ib_umem_odp_unmap_dma_pages(struct ib_umem *umem, u64 start_offset,
 				 u64 bound);
 
-void rbt_ib_umem_insert(struct umem_odp_node *node,
-			struct rb_root_cached *root);
-void rbt_ib_umem_remove(struct umem_odp_node *node,
-			struct rb_root_cached *root);
 typedef int (*umem_call_back)(struct ib_umem *item, u64 start, u64 end,
 			      void *cookie);
 /*

--
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171025155649.9089-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Applied
#2 lore raw
Quoted 15 lines · Leon Romanovsky

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The RDMA/umem uses generic RB-trees macros to generate various ib_umem access functions. The generation is performed with INTERVAL_TREE_DEFINE macro, which allows one of two modes: declare all functions as static or declare none of the function to be static.

The second mode of operation produces the following sparse errors:
drivers/infiniband/core/umem_rbtree.c:69:1:
warning: symbol 'rbt_ib_umem_iter_first' was not declared. Should it be static?
drivers/infiniband/core/umem_rbtree.c:69:1:
warning: symbol 'rbt_ib_umem_iter_next' was not declared. Should it be static?

Quoted 7 lines

Code relocation together with declaration of such functions to be "static" solves the issue.

Because there is no need to have separate file for two functions, let's consolidate umem_rtree.c and umem_odp.c into one file.

Thanks, applied.

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD