summaryrefslogtreecommitdiff
path: root/drivers/ide
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2008-04-28 23:44:43 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 23:44:43 +0200
commiteee49298ddb17ff6646a82b843f151e6a7a10edd (patch)
tree74d41815604ac402ab6a84b8eeb3cf4d5e2ce8c4 /drivers/ide
parenta83ead23449759b14aa1f194576ac442e84d3efb (diff)
ide-cd: clean up cdrom_analyze_sense_data()
[bart: fix handling of bio_sectors(failed_command->bio) == 0] Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c7
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,
{
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)