if (ata_id_has_lba(id)) {
if (ata_id_has_lba48(id))
return ata_id_u64(id, ATA_ID_LBA_CAPACITY_2);
- else
- return ata_id_u32(id, ATA_ID_LBA_CAPACITY);
- } else {
- if (ata_id_current_chs_valid(id))
- return (u32)id[ATA_ID_CUR_CYLS] *
- (u32)id[ATA_ID_CUR_HEADS] *
- (u32)id[ATA_ID_CUR_SECTORS];
- else
- return (u32)id[ATA_ID_CYLS] *
- (u32)id[ATA_ID_HEADS] *
- (u32)id[ATA_ID_SECTORS];
+
+ return ata_id_u32(id, ATA_ID_LBA_CAPACITY);
}
+
+ if (ata_id_current_chs_valid(id))
+ return (u32)id[ATA_ID_CUR_CYLS] * (u32)id[ATA_ID_CUR_HEADS] *
+ (u32)id[ATA_ID_CUR_SECTORS];
+
+ return (u32)id[ATA_ID_CYLS] * (u32)id[ATA_ID_HEADS] *
+ (u32)id[ATA_ID_SECTORS];
}
u64 ata_tf_to_lba48(const struct ata_taskfile *tf)