]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-cd.c
opti621: use PCI clock value provided by controller
[linux-2.6] / drivers / ide / ide-cd.c
index cebe75838408ce3172735a629f67fc88f94c4497..68e7f19dc03662b405363ca23bf0081db73baa4a 100644 (file)
@@ -142,7 +142,6 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
 {
        unsigned long sector;
        unsigned long bio_sectors;
-       unsigned long valid;
        struct cdrom_info *info = drive->driver_data;
 
        if (!cdrom_log_sense(drive, failed_command, sense))
@@ -173,14 +172,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
                                 (sense->information[2] <<  8) |
                                 (sense->information[3]);
 
-                       bio_sectors = bio_sectors(failed_command->bio);
-                       if (bio_sectors < 4)
-                               bio_sectors = 4;
                        if (drive->queue->hardsect_size == 2048)
                                /* device sector size is 2K */
                                sector <<= 2;
+
+                       bio_sectors = max(bio_sectors(failed_command->bio), 4U);
                        sector &= ~(bio_sectors - 1);
-                       valid = (sector - failed_command->sector) << 9;
 
                        if (sector < get_capacity(info->disk) &&
                            drive->probed_capacity - sector < 4 * 75)
@@ -785,7 +782,7 @@ static ide_startstop_t cdrom_start_seek_continuation(ide_drive_t *drive)
 
        sector_div(frame, queue_hardsect_size(drive->queue) >> SECTOR_BITS);
 
-       memset(rq->cmd, 0, sizeof(rq->cmd));
+       memset(rq->cmd, 0, BLK_MAX_CDB);
        rq->cmd[0] = GPCMD_SEEK;
        put_unaligned(cpu_to_be32(frame), (unsigned int *) &rq->cmd[2]);
 
@@ -1697,7 +1694,7 @@ static int ide_cdrom_prep_fs(struct request_queue *q, struct request *rq)
        long block = (long)rq->hard_sector / (hard_sect >> 9);
        unsigned long blocks = rq->hard_nr_sectors / (hard_sect >> 9);
 
-       memset(rq->cmd, 0, sizeof(rq->cmd));
+       memset(rq->cmd, 0, BLK_MAX_CDB);
 
        if (rq_data_dir(rq) == READ)
                rq->cmd[0] = GPCMD_READ_10;