modules: littlefs: use ##__VA_ARGS__ for littlefs log wrappers

LittleFS has some macros resolving to the Zephyr LOG_* ones, use
the ##__VA_ARGS__ for these so that they don't leave a trailing comma if
called with a single argument.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2022-08-31 19:04:49 +00:00 committed by Fabio Baltieri
parent 8bd369953a
commit 6114a72c38
1 changed files with 4 additions and 4 deletions

View File

@ -46,22 +46,22 @@ extern "C"
/* Logging functions when using LittleFS with Zephyr. */
#ifndef LFS_TRACE
#ifdef LFS_YES_TRACE
#define LFS_TRACE(fmt, ...) LOG_DBG("%s:%d:trace: " fmt, __FILE__, __LINE__, __VA_ARGS__)
#define LFS_TRACE(fmt, ...) LOG_DBG("%s:%d:trace: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#else
#define LFS_TRACE(...)
#endif
#endif
#ifndef LFS_DEBUG
#define LFS_DEBUG(fmt, ...) LOG_DBG("%s:%d: " fmt, __FILE__, __LINE__, __VA_ARGS__)
#define LFS_DEBUG(fmt, ...) LOG_DBG("%s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#endif
#ifndef LFS_WARN
#define LFS_WARN(fmt, ...) LOG_WRN("%s:%d: " fmt, __FILE__, __LINE__, __VA_ARGS__)
#define LFS_WARN(fmt, ...) LOG_WRN("%s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#endif
#ifndef LFS_ERROR
#define LFS_ERROR(fmt, ...) LOG_ERR("%s:%d: " fmt, __FILE__, __LINE__, __VA_ARGS__)
#define LFS_ERROR(fmt, ...) LOG_ERR("%s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#endif
/* Runtime assertions */