All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] Code clean ups for 4.8
@ 2016-07-28 16:27 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

The following patches perform some code clean up in preparation for up coming
fixes.

Functionality is not changed.

Dean Luick (6):
  IB/hfi1: Remove unused uctxt->subpid and uctxt->pid
  IB/hfi1: Remove unused function hfi1_mmu_rb_search
  IB/hfi1: Always expect ops functions
  IB/hfi1: Make iovec loop index easy to understand
  IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister()
  IB/hfi1: Rename TID mmu_rb_* functions

Ira Weiny (7):
  IB/hfi1: Fix minor format error
  IB/hfi1: Add parameter names to function declarations
  IB/hfi1: Add parameter names to callback declarations
  IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove
  IB/hfi1: Remove unused sub-context parameter
  IB/hfi1: Use "false" not 0
  IB/hfi1: Restructure hfi1_file_open

 drivers/infiniband/hw/hfi1/file_ops.c     | 18 ++++----
 drivers/infiniband/hw/hfi1/hfi.h          | 11 +++--
 drivers/infiniband/hw/hfi1/mmu_rb.c       | 74 ++++++++-----------------------
 drivers/infiniband/hw/hfi1/mmu_rb.h       | 13 +++---
 drivers/infiniband/hw/hfi1/user_exp_rcv.c | 33 +++++++-------
 drivers/infiniband/hw/hfi1/user_sdma.c    | 11 ++---
 6 files changed, 62 insertions(+), 98 deletions(-)

-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/13] IB/hfi1: Fix minor format error
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 02/13] IB/hfi1: Remove unused uctxt->subpid and uctxt->pid ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Brackets should be on the next line of a function

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/user_sdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c
index 1e266c95056a..86c28851491c 100644
--- a/drivers/infiniband/hw/hfi1/user_sdma.c
+++ b/drivers/infiniband/hw/hfi1/user_sdma.c
@@ -1115,7 +1115,8 @@ static u32 sdma_cache_evict(struct hfi1_user_sdma_pkt_q *pq, u32 npages)
 }
 
 static int pin_vector_pages(struct user_sdma_request *req,
-			    struct user_sdma_iovec *iovec) {
+			    struct user_sdma_iovec *iovec)
+{
 	int ret = 0, pinned, npages, cleared;
 	struct page **pages;
 	struct hfi1_user_sdma_pkt_q *pq = req->pq;
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/13] IB/hfi1: Remove unused uctxt->subpid and uctxt->pid
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-07-28 16:27   ` [PATCH 01/13] IB/hfi1: Fix minor format error ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 03/13] IB/hfi1: Remove unused function hfi1_mmu_rb_search ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

These are no longer needed.

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/file_ops.c | 4 ----
 drivers/infiniband/hw/hfi1/hfi.h      | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c
index d7c07bc7bd14..b80c8d2ac52b 100644
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@ -727,7 +727,6 @@ static int hfi1_file_close(struct inode *inode, struct file *fp)
 
 	if (--uctxt->cnt) {
 		uctxt->active_slaves &= ~(1 << fdata->subctxt);
-		uctxt->subpid[fdata->subctxt] = 0;
 		mutex_unlock(&hfi1_mutex);
 		goto done;
 	}
@@ -753,7 +752,6 @@ static int hfi1_file_close(struct inode *inode, struct file *fp)
 	write_kctxt_csr(dd, uctxt->sc->hw_context, SEND_CTXT_CHECK_ENABLE,
 			hfi1_pkt_default_send_ctxt_mask(dd, uctxt->sc->type));
 	sc_disable(uctxt->sc);
-	uctxt->pid = 0;
 	spin_unlock_irqrestore(&dd->uctxt_lock, flags);
 
 	dd->rcd[uctxt->ctxt] = NULL;
@@ -893,7 +891,6 @@ static int find_shared_ctxt(struct file *fp,
 			}
 			fd->uctxt = uctxt;
 			fd->subctxt  = uctxt->cnt++;
-			uctxt->subpid[fd->subctxt] = current->pid;
 			uctxt->active_slaves |= 1 << fd->subctxt;
 			ret = 1;
 			goto done;
@@ -978,7 +975,6 @@ static int allocate_ctxt(struct file *fp, struct hfi1_devdata *dd,
 			return ret;
 	}
 	uctxt->userversion = uinfo->userversion;
-	uctxt->pid = current->pid;
 	uctxt->flags = HFI1_CAP_UGET(MASK);
 	init_waitqueue_head(&uctxt->wait);
 	strlcpy(uctxt->comm, current->comm, sizeof(uctxt->comm));
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index df43732621ee..63ce587d6f94 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -270,9 +270,6 @@ struct hfi1_ctxtdata {
 	u32 urgent;
 	/* saved total number of polled urgent packets for poll edge trigger */
 	u32 urgent_poll;
-	/* pid of process using this ctxt */
-	pid_t pid;
-	pid_t subpid[HFI1_MAX_SHARED_CTXTS];
 	/* same size as task_struct .comm[], command that opened context */
 	char comm[TASK_COMM_LEN];
 	/* so file ops can get at unit */
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/13] IB/hfi1: Remove unused function hfi1_mmu_rb_search
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-07-28 16:27   ` [PATCH 01/13] IB/hfi1: Fix minor format error ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 02/13] IB/hfi1: Remove unused uctxt->subpid and uctxt->pid ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 04/13] IB/hfi1: Add parameter names to function declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mmu_rb.c | 17 -----------------
 drivers/infiniband/hw/hfi1/mmu_rb.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index b7a80aa1ae30..9289bfaa4911 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -223,23 +223,6 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler,
 		handler->ops->remove(handler->root, node, mm);
 }
 
-struct mmu_rb_node *hfi1_mmu_rb_search(struct rb_root *root, unsigned long addr,
-				       unsigned long len)
-{
-	struct mmu_rb_handler *handler = find_mmu_handler(root);
-	struct mmu_rb_node *node;
-	unsigned long flags;
-
-	if (!handler)
-		return ERR_PTR(-EINVAL);
-
-	spin_lock_irqsave(&handler->lock, flags);
-	node = __mmu_rb_search(handler, addr, len);
-	spin_unlock_irqrestore(&handler->lock, flags);
-
-	return node;
-}
-
 struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
 					unsigned long addr, unsigned long len)
 {
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.h b/drivers/infiniband/hw/hfi1/mmu_rb.h
index 7a57b9c49d27..215c728e52cd 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.h
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.h
@@ -68,8 +68,6 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops);
 void hfi1_mmu_rb_unregister(struct rb_root *);
 int hfi1_mmu_rb_insert(struct rb_root *, struct mmu_rb_node *);
 void hfi1_mmu_rb_remove(struct rb_root *, struct mmu_rb_node *);
-struct mmu_rb_node *hfi1_mmu_rb_search(struct rb_root *, unsigned long,
-				       unsigned long);
 struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *, unsigned long,
 					unsigned long);
 
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/13] IB/hfi1: Add parameter names to function declarations
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 03/13] IB/hfi1: Remove unused function hfi1_mmu_rb_search ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 05/13] IB/hfi1: Add parameter names to callback declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Parameter names to function declarations make it more clear
what those parameters do.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/hfi.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index 63ce587d6f94..6fb86fee0701 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -1700,9 +1700,11 @@ void shutdown_led_override(struct hfi1_pportdata *ppd);
  */
 #define DEFAULT_RCVHDR_ENTSIZE 32
 
-bool hfi1_can_pin_pages(struct hfi1_devdata *, u32, u32);
-int hfi1_acquire_user_pages(unsigned long, size_t, bool, struct page **);
-void hfi1_release_user_pages(struct mm_struct *, struct page **, size_t, bool);
+bool hfi1_can_pin_pages(struct hfi1_devdata *dd, u32 nlocked, u32 npages);
+int hfi1_acquire_user_pages(unsigned long vaddr, size_t npages, bool writable,
+			    struct page **pages);
+void hfi1_release_user_pages(struct mm_struct *mm, struct page **p,
+			     size_t npages, bool dirty);
 
 static inline void clear_rcvhdrtail(const struct hfi1_ctxtdata *rcd)
 {
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/13] IB/hfi1: Add parameter names to callback declarations
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 04/13] IB/hfi1: Add parameter names to function declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 06/13] IB/hfi1: Always expect ops functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

This makes it more clear what these functions are
operating on.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mmu_rb.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.h b/drivers/infiniband/hw/hfi1/mmu_rb.h
index 215c728e52cd..45e7245d813b 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.h
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.h
@@ -57,11 +57,12 @@ struct mmu_rb_node {
 };
 
 struct mmu_rb_ops {
-	bool (*filter)(struct mmu_rb_node *, unsigned long, unsigned long);
-	int (*insert)(struct rb_root *, struct mmu_rb_node *);
-	void (*remove)(struct rb_root *, struct mmu_rb_node *,
-		       struct mm_struct *);
-	int (*invalidate)(struct rb_root *, struct mmu_rb_node *);
+	bool (*filter)(struct mmu_rb_node *node, unsigned long addr,
+		       unsigned long len);
+	int (*insert)(struct rb_root *root, struct mmu_rb_node *mnode);
+	void (*remove)(struct rb_root *root, struct mmu_rb_node *mnode,
+		       struct mm_struct *mm);
+	int (*invalidate)(struct rb_root *root, struct mmu_rb_node *node);
 };
 
 int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops);
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/13] IB/hfi1: Always expect ops functions
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (4 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 05/13] IB/hfi1: Add parameter names to callback declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 07/13] IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Remove, insert, and invalidate are always provided.  No
need to test.

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mmu_rb.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index 9289bfaa4911..525d58afb354 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -99,9 +99,6 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops)
 {
 	struct mmu_rb_handler *handlr;
 
-	if (!ops->invalidate)
-		return -EINVAL;
-
 	handlr = kmalloc(sizeof(*handlr), GFP_KERNEL);
 	if (!handlr)
 		return -ENOMEM;
@@ -143,8 +140,7 @@ void hfi1_mmu_rb_unregister(struct rb_root *root)
 		while ((node = rb_first(root))) {
 			rbnode = rb_entry(node, struct mmu_rb_node, node);
 			rb_erase(node, root);
-			if (handler->ops->remove)
-				handler->ops->remove(root, rbnode, NULL);
+			handler->ops->remove(root, rbnode, NULL);
 		}
 	}
 	spin_unlock_irqrestore(&handler->lock, flags);
@@ -172,11 +168,9 @@ int hfi1_mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *mnode)
 	}
 	__mmu_int_rb_insert(mnode, root);
 
-	if (handler->ops->insert) {
-		ret = handler->ops->insert(root, mnode);
-		if (ret)
-			__mmu_int_rb_remove(mnode, root);
-	}
+	ret = handler->ops->insert(root, mnode);
+	if (ret)
+		__mmu_int_rb_remove(mnode, root);
 unlock:
 	spin_unlock_irqrestore(&handler->lock, flags);
 	return ret;
@@ -219,8 +213,7 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler,
 	__mmu_int_rb_remove(node, handler->root);
 	spin_unlock_irqrestore(&handler->lock, flags);
 
-	if (handler->ops->remove)
-		handler->ops->remove(handler->root, node, mm);
+	handler->ops->remove(handler->root, node, mm);
 }
 
 struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
@@ -300,8 +293,7 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn,
 			  node->addr, node->len);
 		if (handler->ops->invalidate(root, node)) {
 			__mmu_int_rb_remove(node, root);
-			if (handler->ops->remove)
-				handler->ops->remove(root, node, mm);
+			handler->ops->remove(root, node, mm);
 		}
 	}
 	spin_unlock_irqrestore(&handler->lock, flags);
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/13] IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (5 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 06/13] IB/hfi1: Always expect ops functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 08/13] IB/hfi1: Remove unused sub-context parameter ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

__mmu_rb_remove was called in only 1 place which was a very simple
call site.  Combine this function into its caller.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mmu_rb.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index 525d58afb354..b845adf9fc0e 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -200,22 +200,6 @@ static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *handler,
 	return node;
 }
 
-/* Caller must *not* hold handler lock. */
-static void __mmu_rb_remove(struct mmu_rb_handler *handler,
-			    struct mmu_rb_node *node, struct mm_struct *mm)
-{
-	unsigned long flags;
-
-	/* Validity of handler and node pointers has been checked by caller. */
-	hfi1_cdbg(MMU, "Removing node addr 0x%llx, len %u", node->addr,
-		  node->len);
-	spin_lock_irqsave(&handler->lock, flags);
-	__mmu_int_rb_remove(node, handler->root);
-	spin_unlock_irqrestore(&handler->lock, flags);
-
-	handler->ops->remove(handler->root, node, mm);
-}
-
 struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
 					unsigned long addr, unsigned long len)
 {
@@ -237,12 +221,20 @@ struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
 
 void hfi1_mmu_rb_remove(struct rb_root *root, struct mmu_rb_node *node)
 {
+	unsigned long flags;
 	struct mmu_rb_handler *handler = find_mmu_handler(root);
 
 	if (!handler || !node)
 		return;
 
-	__mmu_rb_remove(handler, node, NULL);
+	/* Validity of handler and node pointers has been checked by caller. */
+	hfi1_cdbg(MMU, "Removing node addr 0x%llx, len %u", node->addr,
+		  node->len);
+	spin_lock_irqsave(&handler->lock, flags);
+	__mmu_int_rb_remove(node, handler->root);
+	spin_unlock_irqrestore(&handler->lock, flags);
+
+	handler->ops->remove(handler->root, node, NULL);
 }
 
 static struct mmu_rb_handler *find_mmu_handler(struct rb_root *root)
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/13] IB/hfi1: Remove unused sub-context parameter
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (6 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 07/13] IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 09/13] IB/hfi1: Use "false" not 0 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

subctxt is not used, just remove it.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/user_exp_rcv.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
index 1b640a35b3fe..f16eb25bfcd2 100644
--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
+++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
@@ -94,7 +94,7 @@ static int program_rcvarray(struct file *, unsigned long, struct tid_group *,
 			    struct tid_pageset *, unsigned, u16, struct page **,
 			    u32 *, unsigned *, unsigned *);
 static int unprogram_rcvarray(struct file *, u32, struct tid_group **);
-static void clear_tid_node(struct hfi1_filedata *, u16, struct tid_rb_node *);
+static void clear_tid_node(struct hfi1_filedata *, struct tid_rb_node *);
 
 static struct mmu_rb_ops tid_rb_ops = {
 	.insert = mmu_rb_insert,
@@ -911,12 +911,11 @@ static int unprogram_rcvarray(struct file *fp, u32 tidinfo,
 
 	if (grp)
 		*grp = node->grp;
-	clear_tid_node(fd, fd->subctxt, node);
+	clear_tid_node(fd, node);
 	return 0;
 }
 
-static void clear_tid_node(struct hfi1_filedata *fd, u16 subctxt,
-			   struct tid_rb_node *node)
+static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node)
 {
 	struct hfi1_ctxtdata *uctxt = fd->uctxt;
 	struct hfi1_devdata *dd = uctxt->dd;
@@ -975,7 +974,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,
 				else
 					hfi1_mmu_rb_remove(&fd->tid_rb_root,
 							   &node->mmu);
-				clear_tid_node(fd, -1, node);
+				clear_tid_node(fd, node);
 			}
 		}
 	}
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/13] IB/hfi1: Use "false" not 0
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (7 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 08/13] IB/hfi1: Remove unused sub-context parameter ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 10/13] IB/hfi1: Make iovec loop index easy to understand ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

For bool parameters "false" should be used

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/user_sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c
index 86c28851491c..54640c31b6bb 100644
--- a/drivers/infiniband/hw/hfi1/user_sdma.c
+++ b/drivers/infiniband/hw/hfi1/user_sdma.c
@@ -1224,7 +1224,7 @@ bail:
 static void unpin_vector_pages(struct mm_struct *mm, struct page **pages,
 			       unsigned start, unsigned npages)
 {
-	hfi1_release_user_pages(mm, pages + start, npages, 0);
+	hfi1_release_user_pages(mm, pages + start, npages, false);
 	kfree(pages);
 }
 
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/13] IB/hfi1: Make iovec loop index easy to understand
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (8 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 09/13] IB/hfi1: Use "false" not 0 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 11/13] IB/hfi1: Restructure hfi1_file_open ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/user_sdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c
index 54640c31b6bb..586f07807b27 100644
--- a/drivers/infiniband/hw/hfi1/user_sdma.c
+++ b/drivers/infiniband/hw/hfi1/user_sdma.c
@@ -520,7 +520,7 @@ static u8 dlid_to_selector(u16 dlid)
 int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec,
 				   unsigned long dim, unsigned long *count)
 {
-	int ret = 0, i = 0;
+	int ret = 0, i;
 	struct hfi1_filedata *fd = fp->private_data;
 	struct hfi1_ctxtdata *uctxt = fd->uctxt;
 	struct hfi1_user_sdma_pkt_q *pq = fd->pq;
@@ -657,7 +657,7 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec,
 	idx++;
 
 	/* Save all the IO vector structures */
-	while (i < req->data_iovs) {
+	for (i = 0; i < req->data_iovs; i++) {
 		INIT_LIST_HEAD(&req->iovs[i].list);
 		memcpy(&req->iovs[i].iov, iovec + idx++, sizeof(struct iovec));
 		ret = pin_vector_pages(req, &req->iovs[i]);
@@ -665,7 +665,7 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec,
 			req->status = ret;
 			goto free_req;
 		}
-		req->data_len += req->iovs[i++].iov.iov_len;
+		req->data_len += req->iovs[i].iov.iov_len;
 	}
 	SDMA_DBG(req, "total data length %u", req->data_len);
 
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/13] IB/hfi1: Restructure hfi1_file_open
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (9 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 10/13] IB/hfi1: Make iovec loop index easy to understand ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 12/13] IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister() ira.weiny-ral2JQCrhuEAvxtiuMwx3w
                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Rearrange the file open call in prep for new changes.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/file_ops.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c
index b80c8d2ac52b..0522bafb190b 100644
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@ -168,6 +168,7 @@ static inline int is_valid_mmap(u64 token)
 
 static int hfi1_file_open(struct inode *inode, struct file *fp)
 {
+	struct hfi1_filedata *fd;
 	struct hfi1_devdata *dd = container_of(inode->i_cdev,
 					       struct hfi1_devdata,
 					       user_cdev);
@@ -176,10 +177,15 @@ static int hfi1_file_open(struct inode *inode, struct file *fp)
 	kobject_get(&dd->kobj);
 
 	/* The real work is performed later in assign_ctxt() */
-	fp->private_data = kzalloc(sizeof(struct hfi1_filedata), GFP_KERNEL);
-	if (fp->private_data) /* no cpu affinity by default */
-		((struct hfi1_filedata *)fp->private_data)->rec_cpu_num = -1;
-	return fp->private_data ? 0 : -ENOMEM;
+
+	fd = kzalloc(sizeof(*fd), GFP_KERNEL);
+
+	if (fd) /* no cpu affinity by default */
+		fd->rec_cpu_num = -1;
+
+	fp->private_data = fd;
+
+	return fd ? 0 : -ENOMEM;
 }
 
 static long hfi1_file_ioctl(struct file *fp, unsigned int cmd,
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 12/13] IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister()
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (10 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 11/13] IB/hfi1: Restructure hfi1_file_open ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-07-28 16:27   ` [PATCH 13/13] IB/hfi1: Rename TID mmu_rb_* functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-03  2:52   ` [PATCH 00/13] Code clean ups for 4.8 Doug Ledford
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Checking if the rb tree is empty is redundant with the while loop which is
emptying the rb tree.

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mmu_rb.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index b845adf9fc0e..1c7e25b90a2c 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -118,6 +118,8 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops)
 void hfi1_mmu_rb_unregister(struct rb_root *root)
 {
 	struct mmu_rb_handler *handler = find_mmu_handler(root);
+	struct mmu_rb_node *rbnode;
+	struct rb_node *node;
 	unsigned long flags;
 
 	if (!handler)
@@ -133,15 +135,10 @@ void hfi1_mmu_rb_unregister(struct rb_root *root)
 	synchronize_rcu();
 
 	spin_lock_irqsave(&handler->lock, flags);
-	if (!RB_EMPTY_ROOT(root)) {
-		struct rb_node *node;
-		struct mmu_rb_node *rbnode;
-
-		while ((node = rb_first(root))) {
-			rbnode = rb_entry(node, struct mmu_rb_node, node);
-			rb_erase(node, root);
-			handler->ops->remove(root, rbnode, NULL);
-		}
+	while ((node = rb_first(root))) {
+		rbnode = rb_entry(node, struct mmu_rb_node, node);
+		rb_erase(node, root);
+		handler->ops->remove(root, rbnode, NULL);
 	}
 	spin_unlock_irqrestore(&handler->lock, flags);
 
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 13/13] IB/hfi1: Rename TID mmu_rb_* functions
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (11 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 12/13] IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister() ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-07-28 16:27   ` ira.weiny-ral2JQCrhuEAvxtiuMwx3w
  2016-08-03  2:52   ` [PATCH 00/13] Code clean ups for 4.8 Doug Ledford
  13 siblings, 0 replies; 15+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-07-28 16:27 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dean Luick

From: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Clarify the names of the TID mmu functions.

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/user_exp_rcv.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
index f16eb25bfcd2..8283a6a2bb15 100644
--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
+++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
@@ -86,10 +86,10 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *, struct exp_tid_set *,
 static u32 find_phys_blocks(struct page **, unsigned, struct tid_pageset *);
 static int set_rcvarray_entry(struct file *, unsigned long, u32,
 			      struct tid_group *, struct page **, unsigned);
-static int mmu_rb_insert(struct rb_root *, struct mmu_rb_node *);
-static void mmu_rb_remove(struct rb_root *, struct mmu_rb_node *,
+static int tid_rb_insert(struct rb_root *, struct mmu_rb_node *);
+static void tid_rb_remove(struct rb_root *, struct mmu_rb_node *,
 			  struct mm_struct *);
-static int mmu_rb_invalidate(struct rb_root *, struct mmu_rb_node *);
+static int tid_rb_invalidate(struct rb_root *, struct mmu_rb_node *);
 static int program_rcvarray(struct file *, unsigned long, struct tid_group *,
 			    struct tid_pageset *, unsigned, u16, struct page **,
 			    u32 *, unsigned *, unsigned *);
@@ -97,9 +97,9 @@ static int unprogram_rcvarray(struct file *, u32, struct tid_group **);
 static void clear_tid_node(struct hfi1_filedata *, struct tid_rb_node *);
 
 static struct mmu_rb_ops tid_rb_ops = {
-	.insert = mmu_rb_insert,
-	.remove = mmu_rb_remove,
-	.invalidate = mmu_rb_invalidate
+	.insert = tid_rb_insert,
+	.remove = tid_rb_remove,
+	.invalidate = tid_rb_invalidate
 };
 
 static inline u32 rcventry2tidinfo(u32 rcventry)
@@ -862,7 +862,7 @@ static int set_rcvarray_entry(struct file *fp, unsigned long vaddr,
 	memcpy(node->pages, pages, sizeof(struct page *) * npages);
 
 	if (HFI1_CAP_IS_USET(TID_UNMAP))
-		ret = mmu_rb_insert(root, &node->mmu);
+		ret = tid_rb_insert(root, &node->mmu);
 	else
 		ret = hfi1_mmu_rb_insert(root, &node->mmu);
 
@@ -905,7 +905,7 @@ static int unprogram_rcvarray(struct file *fp, u32 tidinfo,
 	if (!node || node->rcventry != (uctxt->expected_base + rcventry))
 		return -EBADF;
 	if (HFI1_CAP_IS_USET(TID_UNMAP))
-		mmu_rb_remove(&fd->tid_rb_root, &node->mmu, NULL);
+		tid_rb_remove(&fd->tid_rb_root, &node->mmu, NULL);
 	else
 		hfi1_mmu_rb_remove(&fd->tid_rb_root, &node->mmu);
 
@@ -969,7 +969,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,
 				if (!node || node->rcventry != rcventry)
 					continue;
 				if (HFI1_CAP_IS_USET(TID_UNMAP))
-					mmu_rb_remove(&fd->tid_rb_root,
+					tid_rb_remove(&fd->tid_rb_root,
 						      &node->mmu, NULL);
 				else
 					hfi1_mmu_rb_remove(&fd->tid_rb_root,
@@ -980,7 +980,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,
 	}
 }
 
-static int mmu_rb_invalidate(struct rb_root *root, struct mmu_rb_node *mnode)
+static int tid_rb_invalidate(struct rb_root *root, struct mmu_rb_node *mnode)
 {
 	struct hfi1_filedata *fdata =
 		container_of(root, struct hfi1_filedata, tid_rb_root);
@@ -1024,7 +1024,7 @@ static int mmu_rb_invalidate(struct rb_root *root, struct mmu_rb_node *mnode)
 	return 0;
 }
 
-static int mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *node)
+static int tid_rb_insert(struct rb_root *root, struct mmu_rb_node *node)
 {
 	struct hfi1_filedata *fdata =
 		container_of(root, struct hfi1_filedata, tid_rb_root);
@@ -1036,7 +1036,7 @@ static int mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *node)
 	return 0;
 }
 
-static void mmu_rb_remove(struct rb_root *root, struct mmu_rb_node *node,
+static void tid_rb_remove(struct rb_root *root, struct mmu_rb_node *node,
 			  struct mm_struct *mm)
 {
 	struct hfi1_filedata *fdata =
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/13] Code clean ups for 4.8
       [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (12 preceding siblings ...)
  2016-07-28 16:27   ` [PATCH 13/13] IB/hfi1: Rename TID mmu_rb_* functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
@ 2016-08-03  2:52   ` Doug Ledford
  13 siblings, 0 replies; 15+ messages in thread
From: Doug Ledford @ 2016-08-03  2:52 UTC (permalink / raw)
  To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

On Thu, 2016-07-28 at 12:27 -0400, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> The following patches perform some code clean up in preparation for
> up coming
> fixes.
> 
> Functionality is not changed.
> 
> Dean Luick (6):
>   IB/hfi1: Remove unused uctxt->subpid and uctxt->pid
>   IB/hfi1: Remove unused function hfi1_mmu_rb_search
>   IB/hfi1: Always expect ops functions
>   IB/hfi1: Make iovec loop index easy to understand
>   IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister()
>   IB/hfi1: Rename TID mmu_rb_* functions
> 
> Ira Weiny (7):
>   IB/hfi1: Fix minor format error
>   IB/hfi1: Add parameter names to function declarations
>   IB/hfi1: Add parameter names to callback declarations
>   IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove
>   IB/hfi1: Remove unused sub-context parameter
>   IB/hfi1: Use "false" not 0
>   IB/hfi1: Restructure hfi1_file_open
> 
>  drivers/infiniband/hw/hfi1/file_ops.c     | 18 ++++----
>  drivers/infiniband/hw/hfi1/hfi.h          | 11 +++--
>  drivers/infiniband/hw/hfi1/mmu_rb.c       | 74 ++++++++-------------
> ----------
>  drivers/infiniband/hw/hfi1/mmu_rb.h       | 13 +++---
>  drivers/infiniband/hw/hfi1/user_exp_rcv.c | 33 +++++++-------
>  drivers/infiniband/hw/hfi1/user_sdma.c    | 11 ++---
>  6 files changed, 62 insertions(+), 98 deletions(-)
> 

Thanks Ira, series applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-08-03  2:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-28 16:27 [PATCH 00/13] Code clean ups for 4.8 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1469723257-27317-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-07-28 16:27   ` [PATCH 01/13] IB/hfi1: Fix minor format error ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 02/13] IB/hfi1: Remove unused uctxt->subpid and uctxt->pid ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 03/13] IB/hfi1: Remove unused function hfi1_mmu_rb_search ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 04/13] IB/hfi1: Add parameter names to function declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 05/13] IB/hfi1: Add parameter names to callback declarations ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 06/13] IB/hfi1: Always expect ops functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 07/13] IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 08/13] IB/hfi1: Remove unused sub-context parameter ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 09/13] IB/hfi1: Use "false" not 0 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 10/13] IB/hfi1: Make iovec loop index easy to understand ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 11/13] IB/hfi1: Restructure hfi1_file_open ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 12/13] IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister() ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-07-28 16:27   ` [PATCH 13/13] IB/hfi1: Rename TID mmu_rb_* functions ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-08-03  2:52   ` [PATCH 00/13] Code clean ups for 4.8 Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.