Fix CI errors and CPPcheck warnings

This commit is contained in:
Thomas Göttgens 2025-02-04 16:32:10 +01:00
parent 486c56e651
commit 30fffbdc01
3 changed files with 86 additions and 86 deletions

View File

@ -23,7 +23,6 @@
*/ */
#include "STM32_LittleFS.h" #include "STM32_LittleFS.h"
#include "littlefs/lfs.h"
#include <Arduino.h> #include <Arduino.h>
#define rtos_malloc malloc #define rtos_malloc malloc

View File

@ -25,6 +25,8 @@
#ifndef STM32_LITTLEFS_FILE_H_ #ifndef STM32_LITTLEFS_FILE_H_
#define STM32_LITTLEFS_FILE_H_ #define STM32_LITTLEFS_FILE_H_
#include "littlefs/lfs.h"
// Forward declaration // Forward declaration
class STM32_LittleFS; class STM32_LittleFS;

View File

@ -502,7 +502,7 @@ static int lfs_dir_commit(lfs_t *lfs, lfs_dir_t *dir, const struct lfs_region *r
bool relocated = false; bool relocated = false;
while (true) { while (true) {
if (true) {
int err = lfs_bd_erase(lfs, dir->pair[0]); int err = lfs_bd_erase(lfs, dir->pair[0]);
if (err) { if (err) {
if (err == LFS_ERR_CORRUPT) { if (err == LFS_ERR_CORRUPT) {
@ -589,7 +589,6 @@ static int lfs_dir_commit(lfs_t *lfs, lfs_dir_t *dir, const struct lfs_region *r
if (ncrc != crc) { if (ncrc != crc) {
goto relocate; goto relocate;
} }
}
break; break;
relocate: relocate:
@ -607,7 +606,7 @@ static int lfs_dir_commit(lfs_t *lfs, lfs_dir_t *dir, const struct lfs_region *r
} }
// relocate half of pair // relocate half of pair
int err = lfs_alloc(lfs, &dir->pair[0]); err = lfs_alloc(lfs, &dir->pair[0]);
if (err) { if (err) {
return err; return err;
} }