Bladeren bron

ide-cd: minor ide_cdrom_setup() cleanup

Cache drive->queue in local variable and use max().

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz 16 jaren geleden
bovenliggende
commit
e698ea83a8
1 gewijzigde bestanden met toevoegingen van 7 en 8 verwijderingen
  1. 7 8
      drivers/ide/ide-cd.c

+ 7 - 8
drivers/ide/ide-cd.c

@@ -1581,18 +1581,18 @@ static int ide_cdrom_setup(ide_drive_t *drive)
 {
 {
 	struct cdrom_info *cd = drive->driver_data;
 	struct cdrom_info *cd = drive->driver_data;
 	struct cdrom_device_info *cdi = &cd->devinfo;
 	struct cdrom_device_info *cdi = &cd->devinfo;
+	struct request_queue *q = drive->queue;
 	u16 *id = drive->id;
 	u16 *id = drive->id;
 	char *fw_rev = (char *)&id[ATA_ID_FW_REV];
 	char *fw_rev = (char *)&id[ATA_ID_FW_REV];
 	int nslots;
 	int nslots;
 
 
 	ide_debug_log(IDE_DBG_PROBE, "enter");
 	ide_debug_log(IDE_DBG_PROBE, "enter");
 
 
-	blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
-	blk_queue_dma_alignment(drive->queue, 31);
-	blk_queue_update_dma_pad(drive->queue, 15);
-	drive->queue->unplug_delay = (1 * HZ) / 1000;
-	if (!drive->queue->unplug_delay)
-		drive->queue->unplug_delay = 1;
+	blk_queue_prep_rq(q, ide_cdrom_prep_fn);
+	blk_queue_dma_alignment(q, 31);
+	blk_queue_update_dma_pad(q, 15);
+
+	q->unplug_delay = max((1 * HZ) / 1000, 1);
 
 
 	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
 	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
 	drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);
 	drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);
@@ -1610,8 +1610,7 @@ static int ide_cdrom_setup(ide_drive_t *drive)
 
 
 	nslots = ide_cdrom_probe_capabilities(drive);
 	nslots = ide_cdrom_probe_capabilities(drive);
 
 
-	/* set correct block size */
-	blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
+	blk_queue_hardsect_size(q, CD_FRAMESIZE);
 
 
 	if (ide_cdrom_register(drive, nslots)) {
 	if (ide_cdrom_register(drive, nslots)) {
 		printk(KERN_ERR PFX "%s: %s failed to register device with the"
 		printk(KERN_ERR PFX "%s: %s failed to register device with the"