diff options
author | Michael J. Ruhl <michael.j.ruhl@intel.com> | 2017-05-04 05:14:45 -0700 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-05-04 19:31:46 -0400 |
commit | 5042cddfd058a2db419ba7aaadc866e8dccca06c (patch) | |
tree | 4318d7df99e87e849fe1b7a85a26c70fea2b11c4 /drivers/infiniband/hw/hfi1/user_sdma.c | |
parent | f4cd876529194b2d3f653c645ba203688e9e4ba3 (diff) |
IB/hfi1: Use filedata rather than filepointer
Since almost all functions that use the hfi1_filedata get the pointer
from the file pointer, simplify by only passing the hfi1_filedata pointer.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/user_sdma.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_sdma.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index 17142c526c62..4ac4e9d6c464 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -372,9 +372,9 @@ static void sdma_kmem_cache_ctor(void *obj) memset(tx, 0, sizeof(*tx)); } -int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) +int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, + struct hfi1_filedata *fd) { - struct hfi1_filedata *fd; int ret = 0; char buf[64]; struct hfi1_devdata *dd; @@ -382,13 +382,11 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) struct hfi1_user_sdma_pkt_q *pq; unsigned long flags; - if (!uctxt || !fp) { + if (!uctxt || !fd) { ret = -EBADF; goto done; } - fd = fp->private_data; - if (!hfi1_sdma_comp_ring_size) { ret = -EINVAL; goto done; @@ -536,11 +534,11 @@ static u8 dlid_to_selector(u16 dlid) return mapping[hash]; } -int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec, - unsigned long dim, unsigned long *count) +int hfi1_user_sdma_process_request(struct hfi1_filedata *fd, + struct iovec *iovec, unsigned long dim, + unsigned long *count) { 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; struct hfi1_user_sdma_comp_q *cq = fd->cq; |