Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247797
b: refs/heads/master
c: 6677a77
h: refs/heads/master
i:
  247795: 506ea30
v: v3
  • Loading branch information
Phil Sutter authored and Herbert Xu committed May 11, 2011
1 parent 094d034 commit aeb8439
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a1c6bcf269203485d716d8e3bec6671dabb5067
refs/heads/master: 6677a776cf3dc4950a790946f88d26dafc4baf7b
25 changes: 10 additions & 15 deletions trunk/drivers/crypto/mv_cesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len)
{
int ret;
void *sbuf;
int copied = 0;
int copy_len;

while (1) {
while (len) {
if (!p->sg_src_left) {
ret = sg_miter_next(&p->src_sg_it);
BUG_ON(!ret);
Expand All @@ -199,19 +199,14 @@ static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len)

sbuf = p->src_sg_it.addr + p->src_start;

if (p->sg_src_left <= len - copied) {
memcpy(dbuf + copied, sbuf, p->sg_src_left);
copied += p->sg_src_left;
p->sg_src_left = 0;
if (copied >= len)
break;
} else {
int copy_len = len - copied;
memcpy(dbuf + copied, sbuf, copy_len);
p->src_start += copy_len;
p->sg_src_left -= copy_len;
break;
}
copy_len = min(p->sg_src_left, len);
memcpy(dbuf, sbuf, copy_len);

p->src_start += copy_len;
p->sg_src_left -= copy_len;

len -= copy_len;
dbuf += copy_len;
}
}

Expand Down

0 comments on commit aeb8439

Please sign in to comment.