aboutsummaryrefslogtreecommitdiff
path: root/nuttx/fs/fat/fs_configfat.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-02-17 09:14:12 -0800
committerLorenz Meier <lm@inf.ethz.ch>2013-02-17 09:14:12 -0800
commit520a2b417410bed7db6f08a3a69f3bcccc55910b (patch)
tree2365774545ed145c307630b63cb5f075fca71c21 /nuttx/fs/fat/fs_configfat.c
parent2745c3276f5c2377a9713555c5941b17912b6ce7 (diff)
parentcaa11f0bbb7f30679c5c01a64e1d0f6d8627db9d (diff)
downloadpx4-firmware-520a2b417410bed7db6f08a3a69f3bcccc55910b.tar.gz
px4-firmware-520a2b417410bed7db6f08a3a69f3bcccc55910b.tar.bz2
px4-firmware-520a2b417410bed7db6f08a3a69f3bcccc55910b.zip
Merge pull request #198 from PX4/nuttx-merge-5596
Nuttx merge 5596
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");