aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qlogicpti.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-16 06:29:34 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-16 06:29:34 -0400
commit3eed13fd933dbb81db12f7cdec6de9268c4443b5 (patch)
treec16913706acffd4a0b29ec12cd68906b708c9a8a /drivers/scsi/qlogicpti.c
parenta39d113936370ba524fa9e34d6954c3625c8aa64 (diff)
parent2c941a204070ab32d92d40318a3196a7fb994c00 (diff)
Merge branch 'sglist-arch' into for-linus
Diffstat (limited to 'drivers/scsi/qlogicpti.c')
-rw-r--r--drivers/scsi/qlogicpti.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index e93f80316a19..7a2e7986b038 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -868,7 +868,7 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
868 struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr) 868 struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr)
869{ 869{
870 struct dataseg *ds; 870 struct dataseg *ds;
871 struct scatterlist *sg; 871 struct scatterlist *sg, *s;
872 int i, n; 872 int i, n;
873 873
874 if (Cmnd->use_sg) { 874 if (Cmnd->use_sg) {
@@ -884,11 +884,12 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
884 n = sg_count; 884 n = sg_count;
885 if (n > 4) 885 if (n > 4)
886 n = 4; 886 n = 4;
887 for (i = 0; i < n; i++, sg++) { 887 for_each_sg(sg, s, n, i) {
888 ds[i].d_base = sg_dma_address(sg); 888 ds[i].d_base = sg_dma_address(s);
889 ds[i].d_count = sg_dma_len(sg); 889 ds[i].d_count = sg_dma_len(s);
890 } 890 }
891 sg_count -= 4; 891 sg_count -= 4;
892 sg = s;
892 while (sg_count > 0) { 893 while (sg_count > 0) {
893 struct Continuation_Entry *cont; 894 struct Continuation_Entry *cont;
894 895
@@ -907,9 +908,9 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
907 n = sg_count; 908 n = sg_count;
908 if (n > 7) 909 if (n > 7)
909 n = 7; 910 n = 7;
910 for (i = 0; i < n; i++, sg++) { 911 for_each_sg(sg, s, n, i) {
911 ds[i].d_base = sg_dma_address(sg); 912 ds[i].d_base = sg_dma_address(s);
912 ds[i].d_count = sg_dma_len(sg); 913 ds[i].d_count = sg_dma_len(s);
913 } 914 }
914 sg_count -= n; 915 sg_count -= n;
915 } 916 }