From 7d8752afb572c5579cda49edd47e1f900e4c7938 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 17 Oct 2007 13:16:35 +0200 Subject: [PATCH] --- yaml --- r: 70905 b: refs/heads/master c: c79d88b7fa48bc21ffd09903a98b93bf0744bce3 h: refs/heads/master i: 70903: 1f87a846e58b774ca7d35860daf7767df0b23212 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/ide-scsi.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4a7f34537f5f..671f4e213861 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5804509e652fd26227f6da732d5445af444730d3 +refs/heads/master: c79d88b7fa48bc21ffd09903a98b93bf0744bce3 diff --git a/trunk/drivers/scsi/ide-scsi.c b/trunk/drivers/scsi/ide-scsi.c index bd74f6c44b6b..fa7ba64483fb 100644 --- a/trunk/drivers/scsi/ide-scsi.c +++ b/trunk/drivers/scsi/ide-scsi.c @@ -70,7 +70,7 @@ typedef struct idescsi_pc_s { u8 *buffer; /* Data buffer */ u8 *current_position; /* Pointer into the above buffer */ struct scatterlist *sg; /* Scatter gather table */ - struct scatterlist *last_sg; /* Last sg element */ + unsigned int sg_cnt; /* Number of entries in sg */ int b_count; /* Bytes transferred from current entry */ struct scsi_cmnd *scsi_cmd; /* SCSI command */ void (*done)(struct scsi_cmnd *); /* Scsi completion routine */ @@ -192,7 +192,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne } bcount -= count; pc->b_count += count; if (pc->b_count == pc->sg->length) { - if (pc->sg == pc->last_sg) + if (!--pc->sg_cnt) break; pc->sg = sg_next(pc->sg); pc->b_count = 0; @@ -229,7 +229,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign } bcount -= count; pc->b_count += count; if (pc->b_count == pc->sg->length) { - if (pc->sg == pc->last_sg) + if (!--pc->sg_cnt) break; pc->sg = sg_next(pc->sg); pc->b_count = 0; @@ -807,7 +807,7 @@ static int idescsi_queue (struct scsi_cmnd *cmd, memcpy (pc->c, cmd->cmnd, cmd->cmd_len); pc->buffer = NULL; pc->sg = scsi_sglist(cmd); - pc->last_sg = sg_last(pc->sg, scsi_sg_count(cmd)); + pc->sg_cnt = scsi_sg_count(cmd); pc->b_count = 0; pc->request_transfer = pc->buffer_size = scsi_bufflen(cmd); pc->scsi_cmd = cmd;