aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-05-02 04:43:11 -0400
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 00:44:13 -0400
commitd9a683076412924ca03c8b6cb766964425cf822e (patch)
tree2557f230c435ada6af84b3628f175cc83eb63c32 /drivers/ide
parentb13345f39dadbabdabaf8819cf6df26913da9e8d (diff)
ide-floppy/ide_floppy_get_flexible_disk_page: 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')
-rw-r--r--drivers/ide/ide-floppy.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index be21cf23f8cb..060c893820c3 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -311,33 +311,33 @@ static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive,
311{ 311{
312 struct ide_disk_obj *floppy = drive->driver_data; 312 struct ide_disk_obj *floppy = drive->driver_data;
313 struct gendisk *disk = floppy->disk; 313 struct gendisk *disk = floppy->disk;
314 u8 *page; 314 u8 *page, buf[40];
315 int capacity, lba_capacity; 315 int capacity, lba_capacity;
316 u16 transfer_rate, sector_size, cyls, rpm; 316 u16 transfer_rate, sector_size, cyls, rpm;
317 u8 heads, sectors; 317 u8 heads, sectors;
318 318
319 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE); 319 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE);
320 320
321 if (ide_queue_pc_tail(drive, disk, pc, pc->buf, pc->req_xfer)) { 321 if (ide_queue_pc_tail(drive, disk, pc, buf, pc->req_xfer)) {
322 printk(KERN_ERR PFX "Can't get flexible disk page params\n"); 322 printk(KERN_ERR PFX "Can't get flexible disk page params\n");
323 return 1; 323 return 1;
324 } 324 }
325 325
326 if (pc->buf[3] & 0x80) 326 if (buf[3] & 0x80)
327 drive->dev_flags |= IDE_DFLAG_WP; 327 drive->dev_flags |= IDE_DFLAG_WP;
328 else 328 else
329 drive->dev_flags &= ~IDE_DFLAG_WP; 329 drive->dev_flags &= ~IDE_DFLAG_WP;
330 330
331 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP)); 331 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP));
332 332
333 page = &pc->buf[8]; 333 page = &buf[8];
334 334
335 transfer_rate = be16_to_cpup((__be16 *)&pc->buf[8 + 2]); 335 transfer_rate = be16_to_cpup((__be16 *)&buf[8 + 2]);
336 sector_size = be16_to_cpup((__be16 *)&pc->buf[8 + 6]); 336 sector_size = be16_to_cpup((__be16 *)&buf[8 + 6]);
337 cyls = be16_to_cpup((__be16 *)&pc->buf[8 + 8]); 337 cyls = be16_to_cpup((__be16 *)&buf[8 + 8]);
338 rpm = be16_to_cpup((__be16 *)&pc->buf[8 + 28]); 338 rpm = be16_to_cpup((__be16 *)&buf[8 + 28]);
339 heads = pc->buf[8 + 4]; 339 heads = buf[8 + 4];
340 sectors = pc->buf[8 + 5]; 340 sectors = buf[8 + 5];
341 341
342 capacity = cyls * heads * sectors * sector_size; 342 capacity = cyls * heads * sectors * sector_size;
343 343