summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index e89a5ce98d..424e2ba640 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -950,8 +950,7 @@ static void update_fsinfo32(struct bpb *fat_bpb)
950 uint8_t *fsinfo = cache_sector(fat_bpb, fat_bpb->bpb_fsinfo); 950 uint8_t *fsinfo = cache_sector(fat_bpb, fat_bpb->bpb_fsinfo);
951 if (!fsinfo) 951 if (!fsinfo)
952 { 952 {
953 DEBUGF("%s() - Couldn't read FSInfo" 953 DEBUGF("%s() - Couldn't read FSInfo", __func__);
954 " (err code %d)", __func__, rc);
955 return; 954 return;
956 } 955 }
957 956
@@ -972,7 +971,7 @@ static long get_next_cluster32(struct bpb *fat_bpb, long startcluster)
972 if (!sec) 971 if (!sec)
973 { 972 {
974 dc_unlock_cache(); 973 dc_unlock_cache();
975 DEBUGF("%s: Could not cache sector %d\n", __func__, sector); 974 DEBUGF("%s: Could not cache sector %lu\n", __func__, sector);
976 return -1; 975 return -1;
977 } 976 }
978 977
@@ -1045,7 +1044,7 @@ static int update_fat_entry32(struct bpb *fat_bpb, unsigned long entry,
1045 if (!sec) 1044 if (!sec)
1046 { 1045 {
1047 dc_unlock_cache(); 1046 dc_unlock_cache();
1048 DEBUGF("Could not cache sector %u\n", sector); 1047 DEBUGF("Could not cache sector %lu\n", sector);
1049 return -1; 1048 return -1;
1050 } 1049 }
1051 1050
@@ -1544,7 +1543,8 @@ static int write_longname(struct bpb *fat_bpb, struct fat_filestr *parentstr,
1544 unsigned int flags) 1543 unsigned int flags)
1545{ 1544{
1546 DEBUGF("%s(file:%lx, first:%d, num:%d, name:%s)\n", __func__, 1545 DEBUGF("%s(file:%lx, first:%d, num:%d, name:%s)\n", __func__,
1547 parent->info->firstcluster, firstentry, numentries, name); 1546 file->firstcluster, file->e.entry - file->e.entries + 1,
1547 file->e.entries, name);
1548 1548
1549 int rc; 1549 int rc;
1550 union raw_dirent *ent; 1550 union raw_dirent *ent;
@@ -1901,7 +1901,8 @@ static int free_direntries(struct bpb *fat_bpb, struct fat_file *file)
1901 entries; entries--, entry++) 1901 entries; entries--, entry++)
1902 { 1902 {
1903 DEBUGF("Clearing dir entry %d (%d/%d)\n", 1903 DEBUGF("Clearing dir entry %d (%d/%d)\n",
1904 entry, entry - numentries + 1, numentries); 1904 entry, entries - file->e.entries + 1, file->e.entries);
1905
1905 1906
1906 dc_lock_cache(); 1907 dc_lock_cache();
1907 1908
@@ -2374,7 +2375,7 @@ static long transfer(struct bpb *fat_bpb, unsigned long start, long count,
2374 2375
2375 if (rc < 0) 2376 if (rc < 0)
2376 { 2377 {
2377 DEBUGF("Couldn't %s sector %lx (err %d)\n", 2378 DEBUGF("Couldn't %s sector %lx (err %ld)\n",
2378 write ? "write":"read", start, rc); 2379 write ? "write":"read", start, rc);
2379 return rc; 2380 return rc;
2380 } 2381 }
@@ -2803,7 +2804,7 @@ int fat_mount(IF_MV(int volume,) IF_MD(int drive,) unsigned long startsector)
2803 DEBUGF("Freecount: %ld\n", (unsigned long)fat_bpb->fsinfo.freecount); 2804 DEBUGF("Freecount: %ld\n", (unsigned long)fat_bpb->fsinfo.freecount);
2804 DEBUGF("Nextfree: 0x%lx\n", (unsigned long)fat_bpb->fsinfo.nextfree); 2805 DEBUGF("Nextfree: 0x%lx\n", (unsigned long)fat_bpb->fsinfo.nextfree);
2805 DEBUGF("Cluster count: 0x%lx\n", fat_bpb->dataclusters); 2806 DEBUGF("Cluster count: 0x%lx\n", fat_bpb->dataclusters);
2806 DEBUGF("Sectors per cluster: %d\n", fat_bpb->bpb_secperclus); 2807 DEBUGF("Sectors per cluster: %lu\n", fat_bpb->bpb_secperclus);
2807 DEBUGF("FAT sectors: 0x%lx\n", fat_bpb->fatsize); 2808 DEBUGF("FAT sectors: 0x%lx\n", fat_bpb->fatsize);
2808 2809
2809 rc = 0; 2810 rc = 0;