Skip to content

Commit e420c07

Browse files
littlefs2: Properly init class variables (#451)
* littlefs2: Properly init class variables * Style fix
1 parent df00bf8 commit e420c07

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

storage/filesystem/littlefsv2/include/littlefsv2/LittleFileSystem2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ class LittleFileSystem2 : public mbed::FileSystem {
289289
#endif //!(DOXYGEN_ONLY)
290290

291291
private:
292-
lfs2_t _lfs; // The actual file system
293-
struct lfs2_config _config;
294-
mbed::BlockDevice *_bd; // The block device
292+
lfs2_t _lfs{}; // The actual file system
293+
struct lfs2_config _config {};
294+
mbed::BlockDevice *_bd = nullptr; // The block device
295295

296296
// thread-safe locking
297297
rtos::Mutex _mutex;

storage/filesystem/littlefsv2/source/LittleFileSystem2.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ LittleFileSystem2::LittleFileSystem2(const char *name, BlockDevice *bd,
149149
lfs2_size_t cache_size, lfs2_size_t lookahead_size)
150150
: FileSystem(name)
151151
{
152-
memset(&_config, 0, sizeof(_config));
153152
_config.block_size = block_size;
154153
_config.block_cycles = block_cycles;
155154
_config.cache_size = cache_size;

0 commit comments

Comments
 (0)