summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-12 09:42:34 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-12 09:42:34 -0600
commit8e3618762c9118d45d7de472cf0400d5e0c1b3ca (patch)
tree67c6f1905c027682e67a4a3bb13765c28359987f
parent739500903c4800c98dc43e26f09eaa2e8789813a (diff)
downloadpx4-nuttx-8e3618762c9118d45d7de472cf0400d5e0c1b3ca.tar.gz
px4-nuttx-8e3618762c9118d45d7de472cf0400d5e0c1b3ca.tar.bz2
px4-nuttx-8e3618762c9118d45d7de472cf0400d5e0c1b3ca.zip
Cleanup some compilation warnings in NXFFS
-rw-r--r--nuttx/fs/nxffs/Kconfig28
-rw-r--r--nuttx/fs/nxffs/nxffs_initialize.c3
-rw-r--r--nuttx/fs/nxffs/nxffs_pack.c2
-rw-r--r--nuttx/fs/nxffs/nxffs_reformat.c11
4 files changed, 23 insertions, 21 deletions
diff --git a/nuttx/fs/nxffs/Kconfig b/nuttx/fs/nxffs/Kconfig
index b9ef3b276..aa4c603ec 100644
--- a/nuttx/fs/nxffs/Kconfig
+++ b/nuttx/fs/nxffs/Kconfig
@@ -14,15 +14,16 @@ if FS_NXFFS
config NXFFS_PREALLOCATED
bool "Single, preallocated volume"
- default n
+ default y
---help---
If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre-
- allocated NXFFS volume instance.
+ allocated NXFFS volume instance. Currently required because full,
+ dynamic allocation of NXFFS volumes in not yet supporte.
config NXFFS_ERASEDSTATE
hex "FLASH erased state"
default 0xff
- ---help---
+ ---help---
The erased state of FLASH.
This must have one of the values of 0xff or 0x00.
Default: 0xff.
@@ -38,22 +39,21 @@ config NXFFS_PACKTHRESHOLD
config NXFFS_MAXNAMLEN
int "Maximum file name length"
default 255
- ---help---
+ ---help---
The maximum size of an NXFFS file name.
Default: 255.
config NXFFS_TAILTHRESHOLD
int "Tail threshold"
default 8192
- ---help---
- clean-up can either mean
- packing files together toward the end of the file or, if file are
- deleted at the end of the file, clean up can simply mean erasing
- the end of FLASH memory so that it can be re-used again. However,
- doing this can also harm the life of the FLASH part because it can
- mean that the tail end of the FLASH is re-used too often. This
- threshold determines if/when it is worth erased the tail end of FLASH
- and making it available for re-use (and possible over-wear).
- Default: 8192.
+ ---help---
+ Clean-up can either mean packing files together toward the end of
+ the file or, if files are deleted at the end of the file, clean up
+ can simply mean erasing the end of FLASH memory so that it can be
+ re-used again. However, doing this can also harm the life of the
+ FLASH part because it can mean that the tail end of the FLASH is
+ re-used too often. This threshold determines if/when it is worth
+ erased the tail end of FLASH and making it available for re-use
+ (and possible over-wear). Default: 8192.
endif
diff --git a/nuttx/fs/nxffs/nxffs_initialize.c b/nuttx/fs/nxffs/nxffs_initialize.c
index 65b39d19c..83596ee17 100644
--- a/nuttx/fs/nxffs/nxffs_initialize.c
+++ b/nuttx/fs/nxffs/nxffs_initialize.c
@@ -176,8 +176,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
volume = (FAR struct nxffs_volume_s *)kzalloc(sizeof(struct nxffs_volume_s));
if (!volume)
{
- ret = -ENOMEM;
- goto errout;
+ return -ENOMEM;
}
#endif
diff --git a/nuttx/fs/nxffs/nxffs_pack.c b/nuttx/fs/nxffs/nxffs_pack.c
index 4fe3fb681..3d53c0584 100644
--- a/nuttx/fs/nxffs/nxffs_pack.c
+++ b/nuttx/fs/nxffs/nxffs_pack.c
@@ -1275,7 +1275,7 @@ int nxffs_pack(FAR struct nxffs_volume_s *volume)
off_t block;
bool packed;
int i;
- int ret;
+ int ret = OK;
/* Get the offset to the first valid inode entry */
diff --git a/nuttx/fs/nxffs/nxffs_reformat.c b/nuttx/fs/nxffs/nxffs_reformat.c
index d3c00893d..f77a40e06 100644
--- a/nuttx/fs/nxffs/nxffs_reformat.c
+++ b/nuttx/fs/nxffs/nxffs_reformat.c
@@ -211,11 +211,14 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
/* If the erase block was modified, then re-write it */
- nxfrd = MTD_BWRITE(volume->mtd, lblock, volume->blkper, volume->pack);
- if (nxfrd != volume->blkper)
+ if (modified)
{
- fdbg("Write erase block %d failed: %d\n", lblock, nxfrd);
- return -EIO;
+ nxfrd = MTD_BWRITE(volume->mtd, lblock, volume->blkper, volume->pack);
+ if (nxfrd != volume->blkper)
+ {
+ fdbg("Write erase block %d failed: %d\n", lblock, nxfrd);
+ return -EIO;
+ }
}
}