Cleanup some compilation warnings in NXFFS

This commit is contained in:
Gregory Nutt
2013-09-12 09:42:34 -06:00
parent b3194bd5e5
commit 0d02d854ed
4 changed files with 23 additions and 21 deletions
+14 -14
View File
@@ -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
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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 */
+7 -4
View File
@@ -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;
}
}
}