Skip to content

Commit

Permalink
ide-disk: use ATA_ERR
Browse files Browse the repository at this point in the history
Make use of ATA_ERR instead of hard-coded value in idedisk_set_max_address()
and idedisk_read_native_max_address().

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Sergei Shtylyov authored and bzolnier committed Mar 31, 2009
1 parent 74638c8 commit 47ab834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
ide_no_data_taskfile(drive, &cmd);

/* if OK, compute maximum address value */
if ((tf->status & 0x01) == 0)
if (!(tf->status & ATA_ERR))
addr = ide_get_lba_addr(tf, lba48) + 1;

return addr;
Expand Down Expand Up @@ -267,7 +267,7 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
ide_no_data_taskfile(drive, &cmd);

/* if OK, compute maximum address value */
if ((tf->status & 0x01) == 0)
if (!(tf->status & ATA_ERR))
addr_set = ide_get_lba_addr(tf, lba48) + 1;

return addr_set;
Expand Down

0 comments on commit 47ab834

Please sign in to comment.