Skip to content

Commit c8d01e1

Browse files
committed
Edit for style
1 parent 4eed713 commit c8d01e1

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

lfs.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6316,13 +6316,14 @@ lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file) {
63166316
return res;
63176317
}
63186318

6319-
int lfs_file_movehandle(lfs_t *lfs, lfs_file_t *old_file, lfs_file_t *new_file)
6320-
{
6319+
int lfs_file_movehandle(lfs_t *lfs, lfs_file_t *old_file,
6320+
lfs_file_t *new_file) {
63216321
int err = LFS_LOCK(lfs->cfg);
63226322
if (err) {
63236323
return err;
63246324
}
6325-
LFS_TRACE("lfs_file_movehandle(%p, %p, %p)", (void*)lfs, (void*)old_file, (void*)new_file);
6325+
LFS_TRACE("lfs_file_movehandle(%p, %p, %p)",
6326+
(void*)lfs, (void*)old_file, (void*)new_file);
63266327
LFS_ASSERT(lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)old_file));
63276328
LFS_ASSERT(!lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)new_file));
63286329

@@ -6337,8 +6338,7 @@ int lfs_file_movehandle(lfs_t *lfs, lfs_file_t *old_file, lfs_file_t *new_file)
63376338
return err;
63386339
}
63396340

6340-
int lfs_file_ishandleopen(lfs_t *lfs, lfs_file_t *file)
6341-
{
6341+
int lfs_file_ishandleopen(lfs_t *lfs, lfs_file_t *file) {
63426342
int err = LFS_LOCK(lfs->cfg);
63436343
if (err) {
63446344
return err;
@@ -6347,8 +6347,7 @@ int lfs_file_ishandleopen(lfs_t *lfs, lfs_file_t *file)
63476347

63486348
if(lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)file)) {
63496349
err = LFS_ERR_OK;
6350-
}
6351-
else {
6350+
} else {
63526351
err = LFS_ERR_BADF;
63536352
}
63546353

lfs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,10 @@ lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file);
658658

659659
// Move a file handle
660660
//
661-
// Littlefs file handles are somewhat expensive to move.
662-
// Try to avoid needing to move them.
663-
// This allows moving a file handle from old_file to new_file when needed for abstraction.
664-
// After this call, old_file is invalid.
661+
// littlefs's file handles are somewhat expensive to move. Try to avoid
662+
// needing to move them. This allows moving a file handle from old_file
663+
// to new_file when needed for abstraction. After this call, old_file is
664+
// invalid.
665665
//
666666
// Returns a negative error code on failure.
667667
int lfs_file_movehandle(lfs_t *lfs, lfs_file_t *old_file, lfs_file_t *new_file);

tests/test_files.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ code = '''
572572
lfs_file_t file_new;
573573
lfs_file_movehandle(&lfs, &file[idx], &file_new) => 0;
574574
575-
for(int i = 0; i < 3; i++)
576-
{
575+
for(int i = 0; i < 3; i++) {
577576
if(i == idx) {
578577
continue;
579578
}
@@ -582,8 +581,7 @@ code = '''
582581
}
583582
lfs_file_ishandleopen(&lfs, &file_new) => 0;
584583
585-
for(int i = 0; i < 3; i++)
586-
{
584+
for(int i = 0; i < 3; i++) {
587585
if(i == idx) {
588586
continue;
589587
}

0 commit comments

Comments
 (0)