summaryrefslogtreecommitdiff
path: root/nuttx/fs/fat/fs_configfat.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-01 15:32:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-01 15:32:39 +0000
commit7dba70eeaf6654f9837902db9ac290fd5b4cfed4 (patch)
tree2e02176b8ca78da4db5ac2181c8bdb95ab8cd2d2 /nuttx/fs/fat/fs_configfat.c
parent43c642c61857ceefe07ce0fb929c569b52a545a5 (diff)
downloadnuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.tar.gz
nuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.tar.bz2
nuttx-7dba70eeaf6654f9837902db9ac290fd5b4cfed4.zip
Additional patches from Petteri Aimonen for FAT, STM32 SPI, and AT25
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5593 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/fat/fs_configfat.c')
-rw-r--r--nuttx/fs/fat/fs_configfat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/fs/fat/fs_configfat.c b/nuttx/fs/fat/fs_configfat.c
index 2075caa9f..04141ee2b 100644
--- a/nuttx/fs/fat/fs_configfat.c
+++ b/nuttx/fs/fat/fs_configfat.c
@@ -406,7 +406,7 @@ mkfatfs_clustersearchlimits(FAR struct fat_format_s *fmt, FAR struct fat_var_s *
}
/****************************************************************************
- * Name: mkfatfs_try12
+ * Name: mkfatfs_tryfat12
*
* Description:
* Try to define a FAT12 filesystem on the device using the candidate
@@ -462,7 +462,7 @@ mkfatfs_tryfat12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
* FAT12 (remembering that two FAT cluster slots are reserved).
*/
- if (config->fc_nclusters > maxnclusters - 2)
+ if (config->fc_nclusters + 2 > maxnclusters)
{
fvdbg("Too many clusters for FAT12\n");
return -ENFILE;
@@ -472,7 +472,7 @@ mkfatfs_tryfat12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
}
/****************************************************************************
- * Name: mkfatfs_try16
+ * Name: mkfatfs_tryfat16
*
* Description:
* Try to define a FAT16 filesystem on the device using the candidate
@@ -532,7 +532,7 @@ mkfatfs_tryfat16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
* be confused as a FAT12 at mount time.
*/
- if ((config->fc_nclusters > maxnclusters - 2) ||
+ if ((config->fc_nclusters + 2 > maxnclusters) ||
(config->fc_nclusters < FAT_MINCLUST16))
{
fvdbg("Too few or too many clusters for FAT16\n");
@@ -543,7 +543,7 @@ mkfatfs_tryfat16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
}
/****************************************************************************
- * Name: mkfatfs_try32
+ * Name: mkfatfs_tryfat32
*
* Description:
* Try to define a FAT32 filesystem on the device using the candidate
@@ -587,7 +587,7 @@ mkfatfs_tryfat32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
* maxnclusters = nfatsects * sectorsize / 4 - 2
*/
- maxnclusters = (config->fc_nfatsects >> (var->fv_sectshift - 2));
+ maxnclusters = (config->fc_nfatsects << (var->fv_sectshift - 2));
if (maxnclusters > FAT_MAXCLUST32)
{
maxnclusters = FAT_MAXCLUST32;
@@ -599,7 +599,7 @@ mkfatfs_tryfat32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
* FAT32 (remembering that two FAT cluster slots are reserved).
*/
- if ((config->fc_nclusters > maxnclusters - 3) ||
+ if ((config->fc_nclusters + 3 > maxnclusters) ||
(config->fc_nclusters < FAT_MINCLUST32 && fmt->ff_fattype != 32))
{
fvdbg("Too few or too many clusters for FAT32\n");