Skip to content

Commit c7f9a6f

Browse files
Jiapeng Chongtytso
authored andcommitted
ext4: simplify if condition
The if condition !A || A && B can be simplified to !A || B. ./fs/ext4/fast_commit.c:362:21-23: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9837 Signed-off-by: Jiapeng Chong <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 4a622e4 commit c7f9a6f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/ext4/fast_commit.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,7 @@ void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handl
357357
}
358358
spin_lock(&sbi->s_fc_lock);
359359
is_ineligible = ext4_test_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
360-
if (has_transaction &&
361-
(!is_ineligible ||
362-
(is_ineligible && tid_gt(tid, sbi->s_fc_ineligible_tid))))
360+
if (has_transaction && (!is_ineligible || tid_gt(tid, sbi->s_fc_ineligible_tid)))
363361
sbi->s_fc_ineligible_tid = tid;
364362
ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
365363
spin_unlock(&sbi->s_fc_lock);

0 commit comments

Comments
 (0)