From 8a29319a157a69c1755d515e466b3e1c7ed8b76e Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Dec 2020 13:18:22 +1100 Subject: [PATCH] lib/littlefs: Guard lfs2_mlist_isopen with LFS2_NO_ASSERT. To prevent warnings about this function being unused when assertions are disabled. Signed-off-by: Damien George --- lib/littlefs/lfs2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/littlefs/lfs2.c b/lib/littlefs/lfs2.c index 31f3c603e7..1f8c9d2d93 100644 --- a/lib/littlefs/lfs2.c +++ b/lib/littlefs/lfs2.c @@ -425,6 +425,7 @@ static inline void lfs2_superblock_tole32(lfs2_superblock_t *superblock) { superblock->attr_max = lfs2_tole32(superblock->attr_max); } +#ifndef LFS2_NO_ASSERT static inline bool lfs2_mlist_isopen(struct lfs2_mlist *head, struct lfs2_mlist *node) { for (struct lfs2_mlist **p = &head; *p; p = &(*p)->next) { @@ -435,6 +436,7 @@ static inline bool lfs2_mlist_isopen(struct lfs2_mlist *head, return false; } +#endif static inline void lfs2_mlist_remove(lfs2_t *lfs2, struct lfs2_mlist *mlist) { for (struct lfs2_mlist **p = &lfs2->mlist; *p; p = &(*p)->next) {