From c01a97442f278c557ee36962229b3076b94ae588 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 3 Dec 2006 23:22:30 +0000 Subject: 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 --- firmware/drivers/fat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 3924a5c..004e2a7 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) -- cgit v1.1