diff options
-rw-r--r-- | drivers/ide/ide-cd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index cebe75838408..fe9df38f62cc 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -142,7 +142,6 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
142 | { | 142 | { |
143 | unsigned long sector; | 143 | unsigned long sector; |
144 | unsigned long bio_sectors; | 144 | unsigned long bio_sectors; |
145 | unsigned long valid; | ||
146 | struct cdrom_info *info = drive->driver_data; | 145 | struct cdrom_info *info = drive->driver_data; |
147 | 146 | ||
148 | if (!cdrom_log_sense(drive, failed_command, sense)) | 147 | if (!cdrom_log_sense(drive, failed_command, sense)) |
@@ -173,14 +172,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
173 | (sense->information[2] << 8) | | 172 | (sense->information[2] << 8) | |
174 | (sense->information[3]); | 173 | (sense->information[3]); |
175 | 174 | ||
176 | bio_sectors = bio_sectors(failed_command->bio); | ||
177 | if (bio_sectors < 4) | ||
178 | bio_sectors = 4; | ||
179 | if (drive->queue->hardsect_size == 2048) | 175 | if (drive->queue->hardsect_size == 2048) |
180 | /* device sector size is 2K */ | 176 | /* device sector size is 2K */ |
181 | sector <<= 2; | 177 | sector <<= 2; |
178 | |||
179 | bio_sectors = max(bio_sectors(failed_command->bio), 4U); | ||
182 | sector &= ~(bio_sectors - 1); | 180 | sector &= ~(bio_sectors - 1); |
183 | valid = (sector - failed_command->sector) << 9; | ||
184 | 181 | ||
185 | if (sector < get_capacity(info->disk) && | 182 | if (sector < get_capacity(info->disk) && |
186 | drive->probed_capacity - sector < 4 * 75) | 183 | drive->probed_capacity - sector < 4 * 75) |