提交 eee49298 编写于 作者: R Roel Kluin 提交者: Bartlomiej Zolnierkiewicz

ide-cd: clean up cdrom_analyze_sense_data()

[bart: fix handling of bio_sectors(failed_command->bio) == 0]
Signed-off-by: NRoel Kluin <12o3l@tiscali.nl>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 a83ead23
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册