aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-05-04 03:48:57 -0400
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 00:44:31 -0400
commit837272b4f9393df40d16cc2ac731221027048ba6 (patch)
tree9ce093f338af5acdbc624d2777944cf17a2c6204 /drivers/ide/ide-tape.c
parent60cfab85da965035c7baf66a63f048155bb302b1 (diff)
ide-tape/ide_tape_get_bsize_from_bdesc: use local buffer
There should be no functional change resulting from this patch. Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index ef5f34291437..1a8c94055294 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1456,9 +1456,10 @@ static void ide_tape_get_bsize_from_bdesc(ide_drive_t *drive)
1456{ 1456{
1457 idetape_tape_t *tape = drive->driver_data; 1457 idetape_tape_t *tape = drive->driver_data;
1458 struct ide_atapi_pc pc; 1458 struct ide_atapi_pc pc;
1459 u8 buf[12];
1459 1460
1460 idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR); 1461 idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR);
1461 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc.buf, pc.req_xfer)) { 1462 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) {
1462 printk(KERN_ERR "ide-tape: Can't get block descriptor\n"); 1463 printk(KERN_ERR "ide-tape: Can't get block descriptor\n");
1463 if (tape->blk_size == 0) { 1464 if (tape->blk_size == 0) {
1464 printk(KERN_WARNING "ide-tape: Cannot deal with zero " 1465 printk(KERN_WARNING "ide-tape: Cannot deal with zero "
@@ -1467,10 +1468,10 @@ static void ide_tape_get_bsize_from_bdesc(ide_drive_t *drive)
1467 } 1468 }
1468 return; 1469 return;
1469 } 1470 }
1470 tape->blk_size = (pc.buf[4 + 5] << 16) + 1471 tape->blk_size = (buf[4 + 5] << 16) +
1471 (pc.buf[4 + 6] << 8) + 1472 (buf[4 + 6] << 8) +
1472 pc.buf[4 + 7]; 1473 buf[4 + 7];
1473 tape->drv_write_prot = (pc.buf[2] & 0x80) >> 7; 1474 tape->drv_write_prot = (buf[2] & 0x80) >> 7;
1474} 1475}
1475 1476
1476static int idetape_chrdev_open(struct inode *inode, struct file *filp) 1477static int idetape_chrdev_open(struct inode *inode, struct file *filp)