Skip to content

Commit de1f7df

Browse files
committed
minor update
1 parent 65f5701 commit de1f7df

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

libraries/Adafruit_LittleFS/src/Adafruit_LittleFS.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,29 +240,31 @@ bool Adafruit_LittleFS::rmdir_r (char const *filepath)
240240
}
241241

242242
static int _lfs_count(void *p, lfs_block_t block) {
243+
(void) block;
243244
*(size_t *)p += 1;
244-
return 0;
245+
return 0;
245246
}
246247

247248
size_t Adafruit_LittleFS::usedBlocks() {
248249
_lockFS();
249250

250-
size_t blocks = 0;
251-
lfs_traverse(&_lfs, _lfs_count, &blocks);
251+
size_t block_used = 0;
252+
lfs_traverse(&_lfs, _lfs_count, &block_used);
252253

253254
_unlockFS();
254-
return blocks;
255+
return block_used;
255256
}
256257

257258
size_t Adafruit_LittleFS::usedBytes() {
258-
if (nullptr == _lfs_cfg) return 0;
259-
const size_t blocks_used = usedBlocks();
260-
return _lfs_cfg->block_size * blocks_used;
259+
if (nullptr == _lfs_cfg)
260+
return 0;
261+
return _lfs_cfg->block_size * usedBlocks();
261262
}
262263

263264
size_t Adafruit_LittleFS::totalBytes() {
264-
if (nullptr == _lfs_cfg) return 0;
265-
return _lfs_cfg->block_size * _lfs_cfg->block_count;
265+
if (nullptr == _lfs_cfg)
266+
return 0;
267+
return _lfs_cfg->block_size * _lfs_cfg->block_count;
266268
}
267269

268270
//------------- Debug -------------//

0 commit comments

Comments
 (0)