You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
ide-disk: use ide_get_lba_addr()
* Export ide_get_lba_addr().
* Convert idedisk_{read_native,set}_max_address() to use ide_get_lba_addr().
* Remove incorrect comment from idedisk_read_native_max_address()
(noticed by Sergei).
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
+4
-22
@@ -326,18 +326,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
|
||||
ide_no_data_taskfile(drive, &args);
|
||||
|
||||
/* if OK, compute maximum address value */
|
||||
if ((tf->status & 0x01) == 0) {
|
||||
u32 high, low;
|
||||
if ((tf->status & 0x01) == 0)
|
||||
addr = ide_get_lba_addr(tf, lba48) + 1;
|
||||
|
||||
if (lba48)
|
||||
high = (tf->hob_lbah << 16) | (tf->hob_lbam << 8) |
|
||||
tf->hob_lbal;
|
||||
else
|
||||
high = tf->device & 0xf;
|
||||
low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
|
||||
addr = ((__u64)high << 24) | low;
|
||||
addr++; /* since the return value is (maxlba - 1), we add 1 */
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
@@ -373,18 +364,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
|
||||
/* submit command request */
|
||||
ide_no_data_taskfile(drive, &args);
|
||||
/* if OK, compute maximum address value */
|
||||
if ((tf->status & 0x01) == 0) {
|
||||
u32 high, low;
|
||||
if ((tf->status & 0x01) == 0)
|
||||
addr_set = ide_get_lba_addr(tf, lba48) + 1;
|
||||
|
||||
if (lba48)
|
||||
high = (tf->hob_lbah << 16) | (tf->hob_lbam << 8) |
|
||||
tf->hob_lbal;
|
||||
else
|
||||
high = tf->device & 0xf;
|
||||
low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
|
||||
addr_set = ((__u64)high << 24) | low;
|
||||
addr_set++;
|
||||
}
|
||||
return addr_set;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user