Skip to content

Commit

Permalink
nilfs2: remove unnecessary else after return or break
Browse files Browse the repository at this point in the history
This fixes the checkpatch.pl warning that suggests else is not
generally useful after a break or return.

Link: http://lkml.kernel.org/r/1462886671-3521-6-git-send-email-konishi.ryusuke@lab.ntt.co.jp
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
konis committed May 24, 2016
1 parent d7b2b00 commit 61ad594
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
12 changes: 6 additions & 6 deletions fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,12 +1033,12 @@ static __u64 nilfs_btree_find_target_v(const struct nilfs_bmap *btree,
if (ptr != NILFS_BMAP_INVALID_PTR)
/* sequential access */
return ptr;
else {
ptr = nilfs_btree_find_near(btree, path);
if (ptr != NILFS_BMAP_INVALID_PTR)
/* near */
return ptr;
}

ptr = nilfs_btree_find_near(btree, path);
if (ptr != NILFS_BMAP_INVALID_PTR)
/* near */
return ptr;

/* block group */
return nilfs_bmap_find_target_in_group(btree);
}
Expand Down
6 changes: 3 additions & 3 deletions fs/nilfs2/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ nilfs_direct_find_target_v(const struct nilfs_bmap *direct, __u64 key)
if (ptr != NILFS_BMAP_INVALID_PTR)
/* sequential access */
return ptr;
else
/* block group */
return nilfs_bmap_find_target_in_group(direct);

/* block group */
return nilfs_bmap_find_target_in_group(direct);
}

static int nilfs_direct_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr)
Expand Down
26 changes: 12 additions & 14 deletions fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,15 @@ static int nilfs_prepare_segment_lock(struct nilfs_transaction_info *ti)
if (cur_ti) {
if (cur_ti->ti_magic == NILFS_TI_MAGIC)
return ++cur_ti->ti_count;
else {
/*
* If journal_info field is occupied by other FS,
* it is saved and will be restored on
* nilfs_transaction_commit().
*/
printk(KERN_WARNING
"NILFS warning: journal info from a different "
"FS\n");
save = current->journal_info;
}

/*
* If journal_info field is occupied by other FS,
* it is saved and will be restored on
* nilfs_transaction_commit().
*/
printk(KERN_WARNING
"NILFS warning: journal info from a different FS\n");
save = current->journal_info;
}
if (!ti) {
ti = kmem_cache_alloc(nilfs_transaction_cachep, GFP_NOFS);
Expand Down Expand Up @@ -2492,10 +2490,10 @@ static int nilfs_segctor_thread(void *arg)

if (timeout || sci->sc_seq_request != sci->sc_seq_done)
mode = SC_LSEG_SR;
else if (!sci->sc_flush_request)
break;
else
else if (sci->sc_flush_request)
mode = nilfs_segctor_flush_mode(sci);
else
break;

spin_unlock(&sci->sc_state_lock);
nilfs_segctor_thread_construct(sci, mode);
Expand Down

0 comments on commit 61ad594

Please sign in to comment.