1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20053 from benpicco/lwext4_fixes

pkg/lwext4: small fixes
This commit is contained in:
Kaspar Schleiser 2023-11-09 19:28:25 +00:00 committed by GitHub
commit ed52c410a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -250,5 +250,8 @@ MTD_SDMMC_DEV(0, CONFIG_SDMMC_GENERIC_MTD_OFFSET);
#ifdef MODULE_FATFS_VFS
MTD_SDMMC_DEV_FS(0, CONFIG_SDMMC_GENERIC_MTD_OFFSET, fatfs);
#endif
#ifdef MODULE_LWEXT4
MTD_SDMMC_DEV_FS(0, CONFIG_SDMMC_GENERIC_MTD_OFFSET, lwext4);
#endif
#endif

View File

@ -4,6 +4,7 @@ DIRS += $(RIOTPKG)/lwext4/fs
CFLAGS += -DCONFIG_USE_DEFAULT_CFG=1
CFLAGS += -DCONFIG_HAVE_OWN_OFLAGS=0
CFLAGS += -DCONFIG_DEBUG_PRINTF=0
# select ext2/3/4 feature level based on module name
ifneq (,$(filter lwext4_vfs,$(USEMODULE)))

View File

@ -214,7 +214,6 @@ static int _mount(vfs_mount_t *mountp)
}
mp->os_locks = &_lwext4_os_lock;
mp->mounted = true;
res = ext4_recover(fs->mp.name);
if (res != EOK && res != ENOTSUP) {
@ -228,6 +227,7 @@ static int _mount(vfs_mount_t *mountp)
return -res;
}
mp->mounted = true;
ext4_cache_write_back(fs->mp.name, 1);
return -res;

View File

@ -53,7 +53,7 @@ void __attribute__((used)) __wrap_free(void *ptr)
{
if (IS_USED(MODULE_MALLOC_TRACING)) {
uinttxtptr_t pc = cpu_get_caller_pc();
printf("free(%p) @0x%" PRIxTXTPTR ")\n", ptr, pc);
printf("free(%p) @ 0x%" PRIxTXTPTR ")\n", ptr, pc);
}
assert(!irq_is_in());
mutex_lock(&_lock);
@ -73,7 +73,7 @@ void * __attribute__((used)) __wrap_calloc(size_t nmemb, size_t size)
size_t total_size;
if (__builtin_mul_overflow(nmemb, size, &total_size)) {
if (IS_USED(MODULE_MALLOC_TRACING)) {
printf("calloc(%u, %u) @0x%" PRIxTXTPTR " overflowed\n",
printf("calloc(%u, %u) @ 0x%" PRIxTXTPTR " overflowed\n",
(unsigned)nmemb, (unsigned)size, pc);
}
return NULL;
@ -87,7 +87,7 @@ void * __attribute__((used)) __wrap_calloc(size_t nmemb, size_t size)
}
if (IS_USED(MODULE_MALLOC_TRACING)) {
printf("calloc(%u, %u) @0x%" PRIxTXTPTR " returned %p\n",
printf("calloc(%u, %u) @ 0x%" PRIxTXTPTR " returned %p\n",
(unsigned)nmemb, (unsigned)size, pc, res);
}