From af92aff3059a2c393d09f95ffe2d7535fc136377 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 23:09:25 +0100 Subject: [PATCH] --- yaml --- r: 82109 b: refs/heads/master c: 8ee69f5a83660796ffa1d33e67d0064db44cfc23 h: refs/heads/master i: 82107: 3a58af01ad9a46cc3a6646f0be298996f726527d v: v3 --- [refs] | 2 +- trunk/drivers/ide/ide-cd.c | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 5674683cea6c..3f394cb5ee55 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 03f537d50af7381317351396480411b3e00e6c7e +refs/heads/master: 8ee69f5a83660796ffa1d33e67d0064db44cfc23 diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c index 44267fb47f2e..7eb1aa6a3113 100644 --- a/trunk/drivers/ide/ide-cd.c +++ b/trunk/drivers/ide/ide-cd.c @@ -1047,6 +1047,20 @@ static ide_startstop_t cdrom_start_read (ide_drive_t *drive, unsigned int block) * Execute all other packet commands. */ +static void ide_cd_request_sense_fixup(struct request *rq) +{ + /* + * Some of the trailing request sense fields are optional, + * and some drives don't send them. Sigh. + */ + if (rq->cmd[0] == GPCMD_REQUEST_SENSE && + rq->data_len > 0 && rq->data_len <= 5) + while (rq->data_len > 0) { + *(u8 *)rq->data++ = 0; + --rq->data_len; + } +} + /* Interrupt routine for packet command completion. */ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) { @@ -1069,16 +1083,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) /* If DRQ is clear, the command has completed. Complain if we still have data left to transfer. */ if ((stat & DRQ_STAT) == 0) { - /* Some of the trailing request sense fields are optional, and - some drives don't send them. Sigh. */ - if (rq->cmd[0] == GPCMD_REQUEST_SENSE && - rq->data_len > 0 && - rq->data_len <= 5) { - while (rq->data_len > 0) { - *(unsigned char *)rq->data++ = 0; - --rq->data_len; - } - } + ide_cd_request_sense_fixup(rq); if (rq->data_len == 0) cdrom_end_request(drive, 1);