From 55f131c6fdd37b6665f7daa8dde82997403b4bce Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Date: Thu, 16 Jul 2015 01:01:09 +0530 Subject: [PATCH 1/2] Trivial: Fix spelling mistake for SPIFFS_CACHE There is an empty ifdef in src/spiffs.h where SPIFFS_CACHE is misspelled as SPIFFS_CHACHE. Signed-off-by: Ajay Bhargav --- src/spiffs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spiffs.h b/src/spiffs.h index 9b50902..2bf0a6e 100644 --- a/src/spiffs.h +++ b/src/spiffs.h @@ -551,7 +551,7 @@ u32_t SPIFFS_buffer_bytes_for_cache(spiffs *fs, u32_t num_pages); #endif #endif -#if SPIFFS_CHACHE +#if SPIFFS_CACHE #endif #if defined(__cplusplus) } From 389510fd24d2903b0be2a1a4b62c7d39904bde3f Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Date: Thu, 16 Jul 2015 01:18:02 +0530 Subject: [PATCH 2/2] Fix build warnings when SPIFFS_CACHE set to 0 When SPIFFS_CACHE is defined as 0 there are warnings during build for unused variables and unused static functions. This patch fix those build warnings. Signed-off-by: Ajay Bhargav --- src/spiffs_hydrogen.c | 8 ++++++++ src/spiffs_nucleus.c | 1 + 2 files changed, 9 insertions(+) diff --git a/src/spiffs_hydrogen.c b/src/spiffs_hydrogen.c index 977c003..1bd18bb 100644 --- a/src/spiffs_hydrogen.c +++ b/src/spiffs_hydrogen.c @@ -8,7 +8,9 @@ #include "spiffs.h" #include "spiffs_nucleus.h" +#if SPIFFS_CACHE == 1 static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh); +#endif #if SPIFFS_BUFFER_HELP u32_t SPIFFS_buffer_bytes_for_filedescs(spiffs *fs, u32_t num_descs) { @@ -554,6 +556,7 @@ s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh) { } static s32_t spiffs_stat_pix(spiffs *fs, spiffs_page_ix pix, spiffs_file fh, spiffs_stat *s) { + (void)fh; spiffs_page_object_ix_header objix_hdr; spiffs_obj_id obj_id; s32_t res =_spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, fh, @@ -616,7 +619,10 @@ s32_t SPIFFS_fstat(spiffs *fs, spiffs_file fh, spiffs_stat *s) { // Checks if there are any cached writes for the object id associated with // given filehandle. If so, these writes are flushed. +#if SPIFFS_CACHE == 1 static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) { + (void)fs; + (void)fh; s32_t res = SPIFFS_OK; #if SPIFFS_CACHE_WR @@ -645,8 +651,10 @@ static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) { return res; } +#endif s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh) { + (void)fh; SPIFFS_API_CHECK_CFG(fs); SPIFFS_API_CHECK_MOUNT(fs); s32_t res = SPIFFS_OK; diff --git a/src/spiffs_nucleus.c b/src/spiffs_nucleus.c index bfd028f..1eb3c40 100644 --- a/src/spiffs_nucleus.c +++ b/src/spiffs_nucleus.c @@ -83,6 +83,7 @@ s32_t spiffs_phys_cpy( u32_t dst, u32_t src, u32_t len) { + (void)fh; s32_t res; u8_t b[SPIFFS_COPY_BUFFER_STACK]; while (len > 0) {