Fixed compiler warnings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@574 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d71a2bceeb
commit
e5992829d7
3 changed files with 6 additions and 33 deletions
|
@ -189,21 +189,6 @@ static int check_registers(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_harddisk(void)
|
|
||||||
{
|
|
||||||
if (!wait_for_rdy())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if ((ATA_NSECTOR == 1) &&
|
|
||||||
(ATA_SECTOR == 1) &&
|
|
||||||
(ATA_LCYL == 0) &&
|
|
||||||
(ATA_HCYL == 0) &&
|
|
||||||
(ATA_SELECT == 0))
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int freeze_lock(void)
|
static int freeze_lock(void)
|
||||||
{
|
{
|
||||||
if (!wait_for_rdy())
|
if (!wait_for_rdy())
|
||||||
|
@ -274,15 +259,9 @@ int ata_init(void)
|
||||||
if (!check_registers())
|
if (!check_registers())
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
// if (!check_harddisk())
|
|
||||||
// return -3;
|
|
||||||
|
|
||||||
if (freeze_lock() < 0)
|
if (freeze_lock() < 0)
|
||||||
return -4;
|
return -4;
|
||||||
|
|
||||||
// if(ata_spindown(-1) < 0)
|
|
||||||
// return -5;
|
|
||||||
|
|
||||||
ATA_SELECT = SELECT_LBA;
|
ATA_SELECT = SELECT_LBA;
|
||||||
ATA_CONTROL = CONTROL_nIEN;
|
ATA_CONTROL = CONTROL_nIEN;
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ struct fsinfo {
|
||||||
#define FSINFO_FREECOUNT 488
|
#define FSINFO_FREECOUNT 488
|
||||||
#define FSINFO_NEXTFREE 492
|
#define FSINFO_NEXTFREE 492
|
||||||
|
|
||||||
static int first_sector_of_cluster(unsigned int cluster);
|
static int first_sector_of_cluster(int cluster);
|
||||||
static int bpb_is_sane(void);
|
static int bpb_is_sane(void);
|
||||||
static void *cache_fat_sector(int secnum);
|
static void *cache_fat_sector(int secnum);
|
||||||
#ifdef DISK_WRITE
|
#ifdef DISK_WRITE
|
||||||
|
@ -143,13 +143,7 @@ struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
|
||||||
static unsigned char lastsector[SECTOR_SIZE];
|
static unsigned char lastsector[SECTOR_SIZE];
|
||||||
static unsigned char lastsector2[SECTOR_SIZE];
|
static unsigned char lastsector2[SECTOR_SIZE];
|
||||||
|
|
||||||
static unsigned int swap_fat_entry(unsigned int entry)
|
static int sec2cluster(int sec)
|
||||||
{
|
|
||||||
SWAB32(entry);
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sec2cluster(unsigned int sec)
|
|
||||||
{
|
{
|
||||||
if ( sec < fat_bpb.firstdatasector )
|
if ( sec < fat_bpb.firstdatasector )
|
||||||
{
|
{
|
||||||
|
@ -160,7 +154,7 @@ static int sec2cluster(unsigned int sec)
|
||||||
return ((sec - fat_bpb.firstdatasector) / fat_bpb.bpb_secperclus) + 2;
|
return ((sec - fat_bpb.firstdatasector) / fat_bpb.bpb_secperclus) + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cluster2sec(unsigned int cluster)
|
static int cluster2sec(int cluster)
|
||||||
{
|
{
|
||||||
int max_cluster = fat_bpb.totalsectors -
|
int max_cluster = fat_bpb.totalsectors -
|
||||||
fat_bpb.firstdatasector / fat_bpb.bpb_secperclus + 1;
|
fat_bpb.firstdatasector / fat_bpb.bpb_secperclus + 1;
|
||||||
|
@ -175,7 +169,7 @@ static int cluster2sec(unsigned int cluster)
|
||||||
return first_sector_of_cluster(cluster);
|
return first_sector_of_cluster(cluster);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int first_sector_of_cluster(unsigned int cluster)
|
static int first_sector_of_cluster(int cluster)
|
||||||
{
|
{
|
||||||
return (cluster - 2) * fat_bpb.bpb_secperclus + fat_bpb.firstdatasector;
|
return (cluster - 2) * fat_bpb.bpb_secperclus + fat_bpb.firstdatasector;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,8 @@ struct fat_direntry
|
||||||
struct fat_dir
|
struct fat_dir
|
||||||
{
|
{
|
||||||
int entry;
|
int entry;
|
||||||
unsigned int cached_sec;
|
int cached_sec;
|
||||||
unsigned int num_sec;
|
int num_sec;
|
||||||
unsigned char cached_buf[SECTOR_SIZE];
|
unsigned char cached_buf[SECTOR_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue