]> Git Repo - J-linux.git/commitdiff
ext4: simplify if condition
authorJiapeng Chong <[email protected]>
Fri, 30 Aug 2024 07:17:13 +0000 (15:17 +0800)
committerTheodore Ts'o <[email protected]>
Wed, 13 Nov 2024 04:54:13 +0000 (23:54 -0500)
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]>
fs/ext4/fast_commit.c

index b33664f6ce2abdc16a0b0b165a833ebb6eda0092..3dee94a38a688ffb3ae22eb53dd9519f94d31fab 100644 (file)
@@ -357,9 +357,7 @@ void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handl
        }
        spin_lock(&sbi->s_fc_lock);
        is_ineligible = ext4_test_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
-       if (has_transaction &&
-           (!is_ineligible ||
-            (is_ineligible && tid_gt(tid, sbi->s_fc_ineligible_tid))))
+       if (has_transaction && (!is_ineligible || tid_gt(tid, sbi->s_fc_ineligible_tid)))
                sbi->s_fc_ineligible_tid = tid;
        ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
        spin_unlock(&sbi->s_fc_lock);
This page took 0.045474 seconds and 4 git commands to generate.