diff options
author | Borislav Petkov <petkovbb@gmail.com> | 2009-05-02 04:58:17 -0400 |
---|---|---|
committer | Borislav Petkov <petkovbb@gmail.com> | 2009-05-15 00:44:23 -0400 |
commit | ae3a8387be529e632eac69b342524c25b892fc63 (patch) | |
tree | 30f9d6c3480e4c3fe8fdaf3bfa004911a54eadbd /drivers/ide | |
parent | 5122e5174f872c9f3120c8aff71c448f84b6f038 (diff) |
ide-atapi: use local sense buffer
Access the sense buffer through the bio in ->pc_callback method thus
alleviating the need for the pc->buf pointer.
There should be no functional change resulting from this patch.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-atapi.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index b12be1f17f14..66ea1e7774fd 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -253,7 +253,9 @@ void ide_retry_pc(ide_drive_t *drive) | |||
253 | /* init pc from sense_rq */ | 253 | /* init pc from sense_rq */ |
254 | ide_init_pc(pc); | 254 | ide_init_pc(pc); |
255 | memcpy(pc->c, sense_rq->cmd, 12); | 255 | memcpy(pc->c, sense_rq->cmd, 12); |
256 | pc->buf = bio_data(sense_rq->bio); /* pointer to mapped address */ | 256 | |
257 | /* pointer to mapped address */ | ||
258 | pc->buf = bio_data(sense_rq->bio); | ||
257 | pc->req_xfer = blk_rq_bytes(sense_rq); | 259 | pc->req_xfer = blk_rq_bytes(sense_rq); |
258 | 260 | ||
259 | if (drive->media == ide_tape) | 261 | if (drive->media == ide_tape) |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 060c893820c3..14e5e9ca2ad9 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -77,7 +77,8 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
77 | (rq && blk_pc_request(rq))) | 77 | (rq && blk_pc_request(rq))) |
78 | uptodate = 1; /* FIXME */ | 78 | uptodate = 1; /* FIXME */ |
79 | else if (pc->c[0] == GPCMD_REQUEST_SENSE) { | 79 | else if (pc->c[0] == GPCMD_REQUEST_SENSE) { |
80 | u8 *buf = pc->buf; | 80 | |
81 | u8 *buf = bio_data(rq->bio); | ||
81 | 82 | ||
82 | if (!pc->error) { | 83 | if (!pc->error) { |
83 | floppy->sense_key = buf[2] & 0x0F; | 84 | floppy->sense_key = buf[2] & 0x0F; |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 1f7f50473a4f..ef5f34291437 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -288,11 +288,12 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i) | |||
288 | * called on each failed packet command retry to analyze the request sense. We | 288 | * called on each failed packet command retry to analyze the request sense. We |
289 | * currently do not utilize this information. | 289 | * currently do not utilize this information. |
290 | */ | 290 | */ |
291 | static void idetape_analyze_error(ide_drive_t *drive, u8 *sense) | 291 | static void idetape_analyze_error(ide_drive_t *drive) |
292 | { | 292 | { |
293 | idetape_tape_t *tape = drive->driver_data; | 293 | idetape_tape_t *tape = drive->driver_data; |
294 | struct ide_atapi_pc *pc = drive->failed_pc; | 294 | struct ide_atapi_pc *pc = drive->failed_pc; |
295 | struct request *rq = drive->hwif->rq; | 295 | struct request *rq = drive->hwif->rq; |
296 | u8 *sense = bio_data(rq->bio); | ||
296 | 297 | ||
297 | tape->sense_key = sense[2] & 0xF; | 298 | tape->sense_key = sense[2] & 0xF; |
298 | tape->asc = sense[12]; | 299 | tape->asc = sense[12]; |
@@ -362,7 +363,7 @@ static int ide_tape_callback(ide_drive_t *drive, int dsc) | |||
362 | 363 | ||
363 | if (pc->c[0] == REQUEST_SENSE) { | 364 | if (pc->c[0] == REQUEST_SENSE) { |
364 | if (uptodate) | 365 | if (uptodate) |
365 | idetape_analyze_error(drive, pc->buf); | 366 | idetape_analyze_error(drive); |
366 | else | 367 | else |
367 | printk(KERN_ERR "ide-tape: Error in REQUEST SENSE " | 368 | printk(KERN_ERR "ide-tape: Error in REQUEST SENSE " |
368 | "itself - Aborting request!\n"); | 369 | "itself - Aborting request!\n"); |