Re: [PATCH 03/14] ide-atapi: switch to rq->resid_len

Sergei Shtylyov
2009-05-12T14:38:20Z

Hello.

Borislav Petkov wrote:

> Now that we have rq->resid_len, use it to account partial completion
> amount during the lifetime of an rq, decrementing it on each successful
> transfer. As a result, get rid of now unused pc->xferred.

> While at it, remove noisy debug call in ide_prep_sense.

> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

> diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> index cacffd4..1f2af8b 100644
> --- a/drivers/ide/ide-atapi.c
> +++ b/drivers/ide/ide-atapi.c

[...]

> @@ -633,8 +631,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
> } else {
> pc = drive->pc;
>
> - /* We haven't transferred any data yet */
> - pc->xferred = 0;
>
> valid_tf = IDE_VALID_DEVICE;
> bytes = blk_rq_bytes(rq);

You forgot to kill the empty line too...

> @@ -643,6 +639,9 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
> : min_t(unsigned int,
> bytes, 63 * 1024));
>
> + /* We haven't transferred any data yet */
> + rq->resid_len = bcount;
> +
> if (pc->flags & PC_FLAG_DMA_ERROR) {
> pc->flags &= ~PC_FLAG_DMA_ERROR;
> ide_dma_off(drive);

MBR, Sergei