summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-12-03 23:22:30 +0000
committerJens Arnold <amiconn@rockbox.org>2006-12-03 23:22:30 +0000
commitc01a97442f278c557ee36962229b3076b94ae588 (patch)
treef766b0980796365f51963af43dd737938c01d679
parent31ffd7b1540c42e9cc051dc73a1f3acf77885e5d (diff)
downloadrockbox-c01a97442f278c557ee36962229b3076b94ae588.tar.gz
rockbox-c01a97442f278c557ee36962229b3076b94ae588.zip
Removed unused variable, and fixed overflow in free/total calculation. There are still some suspicious things in here...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11656 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/fat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 3924a5cb89..004e2a78ca 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -169,8 +169,6 @@ struct bpb
int secmult; /* bpb_bytspersec / PHYSICAL_SECTOR_SIZE */
};
-int fat_sector_size;
-
static struct bpb fat_bpbs[NUM_VOLUMES]; /* mounted partition info */
static int update_fsinfo(IF_MV_NONVOID(struct bpb* fat_bpb));
@@ -238,10 +236,10 @@ void fat_size(IF_MV2(int volume,) unsigned long* size, unsigned long* free)
struct bpb* fat_bpb = &fat_bpbs[volume];
if (size)
*size = (fat_bpb->dataclusters * fat_bpb->bpb_secperclus
- * fat_bpb->bpb_bytspersec) / 1024;
+ * fat_bpb->secmult) / 2;
if (free)
*free = (fat_bpb->fsinfo.freecount * fat_bpb->bpb_secperclus
- * fat_bpb->bpb_bytspersec) / 1024;
+ * fat_bpb->secmult) / 2;
}
void fat_init(void)