projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ffc548b
)
IB/srp: Move code out of a loop
author
Bart Van Assche
<
[email protected]
>
Fri, 22 Apr 2016 21:14:43 +0000
(14:14 -0700)
committer
Doug Ledford
<
[email protected]
>
Thu, 12 May 2016 18:18:57 +0000
(14:18 -0400)
Since all srp_map_finish_fr() callers pass a non-zero value as
the fourth argument (sg_nents), the sg_nents == 0 check in that
function can be removed. Add a count == 0 check in the caller
of that function.
Signed-off-by: Bart Van Assche <
[email protected]
>
Cc: Christoph Hellwig <
[email protected]
>
Cc: Sagi Grimberg <
[email protected]
>
Cc: Laurence Oberman <
[email protected]
>
Reviewed-by: Sagi Grimberg <
[email protected]
>
Reviewed-by: Christoph Hellwig <
[email protected]
>
Signed-off-by: Doug Ledford <
[email protected]
>
drivers/infiniband/ulp/srp/ib_srp.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/ulp/srp/ib_srp.c
b/drivers/infiniband/ulp/srp/ib_srp.c
index fbd2edbedf055ebf488a9834f0a43cab56793f29..ce2c379272cfb504a569f0f938e0c696814107e5 100644
(file)
--- a/
drivers/infiniband/ulp/srp/ib_srp.c
+++ b/
drivers/infiniband/ulp/srp/ib_srp.c
@@
-1315,9
+1315,6
@@
static int srp_map_finish_fr(struct srp_map_state *state,
WARN_ON_ONCE(!dev->use_fast_reg);
- if (sg_nents == 0)
- return 0;
-
if (sg_nents == 1 && target->global_mr) {
srp_map_desc(state, sg_dma_address(state->sg),
sg_dma_len(state->sg),
@@
-1439,6
+1436,9
@@
static int srp_map_sg_fr(struct srp_map_state *state, struct srp_rdma_ch *ch,
state->fr.end = req->fr_list + ch->target->cmd_sg_cnt;
state->sg = scat;
+ if (count == 0)
+ return 0;
+
while (count) {
int i, n;