Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89248
b: refs/heads/master
c: a5987e0
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 17, 2008
1 parent 802851e commit 96d2755
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06993d2237da45615b5a9a4dde3f344ce97ca17d
refs/heads/master: a5987e0a1b569146ed9cfa0a8c275a21b344fcaa
12 changes: 6 additions & 6 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ static u64 ata_id_n_sectors(const u16 *id)
}
}

static u64 ata_tf_to_lba48(struct ata_taskfile *tf)
u64 ata_tf_to_lba48(const struct ata_taskfile *tf)
{
u64 sectors = 0;

Expand All @@ -1222,10 +1222,10 @@ static u64 ata_tf_to_lba48(struct ata_taskfile *tf)
sectors |= (tf->lbam & 0xff) << 8;
sectors |= (tf->lbal & 0xff);

return ++sectors;
return sectors;
}

static u64 ata_tf_to_lba(struct ata_taskfile *tf)
u64 ata_tf_to_lba(const struct ata_taskfile *tf)
{
u64 sectors = 0;

Expand All @@ -1234,7 +1234,7 @@ static u64 ata_tf_to_lba(struct ata_taskfile *tf)
sectors |= (tf->lbam & 0xff) << 8;
sectors |= (tf->lbal & 0xff);

return ++sectors;
return sectors;
}

/**
Expand Down Expand Up @@ -1279,9 +1279,9 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors)
}

if (lba48)
*max_sectors = ata_tf_to_lba48(&tf);
*max_sectors = ata_tf_to_lba48(&tf) + 1;
else
*max_sectors = ata_tf_to_lba(&tf);
*max_sectors = ata_tf_to_lba(&tf) + 1;
if (dev->horkage & ATA_HORKAGE_HPA_SIZE)
(*max_sectors)--;
return 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/ata/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ extern int libata_fua;
extern int libata_noacpi;
extern int libata_allow_tpm;
extern void ata_force_cbl(struct ata_port *ap);
extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf);
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
u64 block, u32 n_block, unsigned int tf_flags,
Expand Down

0 comments on commit 96d2755

Please sign in to comment.