Commit 0904f327 authored by Ira Weiny's avatar Ira Weiny Committed by Doug Ledford

IB/hfi1: Remove unnecessary done label in hfi1_write_iter

Simple code clean up of hfi1_write_iter.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent f8181697
...@@ -392,41 +392,38 @@ static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from) ...@@ -392,41 +392,38 @@ static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from)
struct hfi1_filedata *fd = kiocb->ki_filp->private_data; struct hfi1_filedata *fd = kiocb->ki_filp->private_data;
struct hfi1_user_sdma_pkt_q *pq = fd->pq; struct hfi1_user_sdma_pkt_q *pq = fd->pq;
struct hfi1_user_sdma_comp_q *cq = fd->cq; struct hfi1_user_sdma_comp_q *cq = fd->cq;
int ret = 0, done = 0, reqs = 0; int done = 0, reqs = 0;
unsigned long dim = from->nr_segs; unsigned long dim = from->nr_segs;
if (!cq || !pq) { if (!cq || !pq)
ret = -EIO; return -EIO;
goto done;
}
if (!iter_is_iovec(from) || !dim) { if (!iter_is_iovec(from) || !dim)
ret = -EINVAL; return -EINVAL;
goto done;
}
hfi1_cdbg(SDMA, "SDMA request from %u:%u (%lu)", hfi1_cdbg(SDMA, "SDMA request from %u:%u (%lu)",
fd->uctxt->ctxt, fd->subctxt, dim); fd->uctxt->ctxt, fd->subctxt, dim);
if (atomic_read(&pq->n_reqs) == pq->n_max_reqs) { if (atomic_read(&pq->n_reqs) == pq->n_max_reqs)
ret = -ENOSPC; return -ENOSPC;
goto done;
}
while (dim) { while (dim) {
int ret;
unsigned long count = 0; unsigned long count = 0;
ret = hfi1_user_sdma_process_request( ret = hfi1_user_sdma_process_request(
kiocb->ki_filp, (struct iovec *)(from->iov + done), kiocb->ki_filp, (struct iovec *)(from->iov + done),
dim, &count); dim, &count);
if (ret) if (ret) {
goto done; reqs = ret;
break;
}
dim -= count; dim -= count;
done += count; done += count;
reqs++; reqs++;
} }
done:
return ret ? ret : reqs; return reqs;
} }
static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment