Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89663
b: refs/heads/master
c: f7441a7
h: refs/heads/master
i:
  89661: e91518e
  89659: d872d31
  89655: 66d187f
  89647: 0aa792c
  89631: e5201c0
  89599: 9e65dc4
v: v3
  • Loading branch information
Geert Uytterhoeven authored and James Bottomley committed Apr 7, 2008
1 parent c7460a7 commit 56db4ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 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: d1e4c9c57c2ed4722795443db22a5d813cd4f0e5
refs/heads/master: f7441a791aeaeac2e1f1f71b485d1372016f9285
30 changes: 14 additions & 16 deletions trunk/drivers/scsi/ps3rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static int ps3rom_slave_configure(struct scsi_device *scsi_dev)
*/
static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
{
int k, req_len, act_len, len, active;
int k, req_len, len, fin;
void *kaddr;
struct scatterlist *sgpnt;
unsigned int buflen;
Expand All @@ -107,24 +107,22 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
if (!scsi_sglist(cmd))
return -1;

active = 1;
req_len = act_len = 0;
req_len = fin = 0;
scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) {
if (active) {
kaddr = kmap_atomic(sg_page(sgpnt), KM_IRQ0);
len = sgpnt->length;
if ((req_len + len) > buflen) {
active = 0;
len = buflen - req_len;
}
memcpy(kaddr + sgpnt->offset, buf + req_len, len);
flush_kernel_dcache_page(sg_page(sgpnt));
kunmap_atomic(kaddr, KM_IRQ0);
act_len += len;
kaddr = kmap_atomic(sg_page(sgpnt), KM_IRQ0);
len = sgpnt->length;
if ((req_len + len) > buflen) {
len = buflen - req_len;
fin = 1;
}
req_len += sgpnt->length;
memcpy(kaddr + sgpnt->offset, buf + req_len, len);
flush_kernel_dcache_page(sg_page(sgpnt));
kunmap_atomic(kaddr, KM_IRQ0);
req_len += len;
if (fin)
break;
}
scsi_set_resid(cmd, buflen - act_len);
scsi_set_resid(cmd, buflen - req_len);
return 0;
}

Expand Down

0 comments on commit 56db4ca

Please sign in to comment.