summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2011-03-24 14:51:23 +0000
committerMichael Sparmann <theseven@rockbox.org>2011-03-24 14:51:23 +0000
commit26f63070c2da61a2407f1146837aa81603f7a59a (patch)
treed00cd6c4bc36e80743b17ef4fe08027bc256eccc /firmware
parent688545ea16670f4e42187cd3095e55286f610462 (diff)
downloadrockbox-26f63070c2da61a2407f1146837aa81603f7a59a.tar.gz
rockbox-26f63070c2da61a2407f1146837aa81603f7a59a.tar.bz2
rockbox-26f63070c2da61a2407f1146837aa81603f7a59a.zip
iPod Classic storage driver: Fix some implicit casts, typos, ...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
index 79a8964c3c..3bf81571fe 100644
--- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
@@ -68,12 +68,15 @@ static int dma_mode = 0;
#ifdef ATA_HAVE_BBT
-char ata_bbtbuf[ATA_BBT_PAGES * 64];
+char ata_bbt_buf[ATA_BBT_PAGES * 64];
uint16_t (*ata_bbt)[0x20];
uint64_t ata_virtual_sectors;
uint32_t ata_last_offset;
uint64_t ata_last_phys;
+int ata_rw_sectors_internal(uint64_t sector, uint32_t count,
+ void* buffer, bool write);
+
int ata_bbt_read_sectors(uint32_t sector, uint32_t count, void* buffer)
{
if (ata_last_phys != sector - 1 && ata_last_phys > sector - 64) ata_soft_reset();
@@ -83,7 +86,7 @@ int ata_bbt_read_sectors(uint32_t sector, uint32_t count, void* buffer)
ata_last_offset = 0;
if (IS_ERR(rc))
panicf("ATA: Error %08X while reading BBT (sector %d, count %d)\n",
- rc, sector, count);
+ (unsigned int)rc, (unsigned int)sector, (unsigned int)count);
return rc;
}
#endif
@@ -836,7 +839,7 @@ int ata_bbt_translate(uint64_t sector, uint32_t count, uint64_t* phys, uint32_t*
{
uint32_t l3idx = sector & 0x1f;
uint32_t l3data = ata_bbt[l2data & 0x7fff][l3idx];
- for (*physcount = 1; *physcount < count && l3idx + *physcount < 0x20; *physcount++)
+ for (*physcount = 1; *physcount < count && l3idx + *physcount < 0x20; (*physcount)++)
if (ata_bbt[l2data & 0x7fff][l3idx + *physcount] != l3data)
break;
offset = l3data + base;
@@ -1023,7 +1026,6 @@ long ata_last_disk_activity(void)
void ata_bbt_disable(void)
{
mutex_lock(&ata_mutex);
- if (ata_bbt) free(ata_bbt);
ata_bbt = NULL;
ata_virtual_sectors = ata_total_sectors;
mutex_unlock(&ata_mutex);
@@ -1044,7 +1046,8 @@ void ata_bbt_reload(void)
ata_virtual_sectors = (((uint64_t)buf[0x1fd]) << 32) | buf[0x1fc];
uint32_t count = buf[0x1ff];
if (count > ATA_BBT_PAGES / 64)
- panicf("ATA: BBT too big! (space: %d, size: %d)", ATA_BBT_PAGES, count * 64);
+ panicf("ATA: BBT too big! (space: %d, size: %d)",
+ ATA_BBT_PAGES, (unsigned int)(count * 64));
uint32_t i;
uint32_t cnt;
ata_bbt = (typeof(ata_bbt))ata_bbt_buf;