aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-tape.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 4e93a82f57ed..3c61770020ef 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1641,12 +1641,12 @@ static int idetape_create_prevent_cmd(ide_drive_t *drive,
1641 return 1; 1641 return 1;
1642} 1642}
1643 1643
1644static int __idetape_discard_read_pipeline(ide_drive_t *drive) 1644static void __idetape_discard_read_pipeline(ide_drive_t *drive)
1645{ 1645{
1646 idetape_tape_t *tape = drive->driver_data; 1646 idetape_tape_t *tape = drive->driver_data;
1647 1647
1648 if (tape->chrdev_dir != IDETAPE_DIR_READ) 1648 if (tape->chrdev_dir != IDETAPE_DIR_READ)
1649 return 0; 1649 return;
1650 1650
1651 clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags); 1651 clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags);
1652 tape->merge_stage_size = 0; 1652 tape->merge_stage_size = 0;
@@ -1656,8 +1656,6 @@ static int __idetape_discard_read_pipeline(ide_drive_t *drive)
1656 } 1656 }
1657 1657
1658 tape->chrdev_dir = IDETAPE_DIR_NONE; 1658 tape->chrdev_dir = IDETAPE_DIR_NONE;
1659
1660 return 0;
1661} 1659}
1662 1660
1663/* 1661/*
@@ -1689,13 +1687,12 @@ static void idetape_discard_read_pipeline(ide_drive_t *drive,
1689 int restore_position) 1687 int restore_position)
1690{ 1688{
1691 idetape_tape_t *tape = drive->driver_data; 1689 idetape_tape_t *tape = drive->driver_data;
1692 int cnt;
1693 int seek, position; 1690 int seek, position;
1694 1691
1695 cnt = __idetape_discard_read_pipeline(drive); 1692 __idetape_discard_read_pipeline(drive);
1696 if (restore_position) { 1693 if (restore_position) {
1697 position = idetape_read_position(drive); 1694 position = idetape_read_position(drive);
1698 seek = position > cnt ? position - cnt : 0; 1695 seek = position > 0 ? position : 0;
1699 if (idetape_position_tape(drive, seek, 0, 0)) { 1696 if (idetape_position_tape(drive, seek, 0, 0)) {
1700 printk(KERN_INFO "ide-tape: %s: position_tape failed in" 1697 printk(KERN_INFO "ide-tape: %s: position_tape failed in"
1701 " discard_pipeline()\n", tape->name); 1698 " discard_pipeline()\n", tape->name);