From nobody Sun Feb 8 07:26:55 2026 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FD999474; Fri, 30 Aug 2024 07:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725002250; cv=none; b=FUJ90aPGeNWDT/oHdivQriF/tv3gdH7CLb8o/hunuIqNmOVXW/rT7jc9i/LX5OIWVAYgLKPt0qOkICvbKyXcSbF6tgXrYBp4qP7NqOucO1EWrLT0uMXXL7unxjB8SQSNJnodHNwZl5Mgr58jBRQL4tXbgEm/YQHXqpBj4zfahvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725002250; c=relaxed/simple; bh=3K+D8fMyMjgEjgzsQsdqG3DrghbUiUYKhUmOe+TpFCc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=BrGF+qPr+wV6Ek4oHLz9Y2lrEdd5CUeuuDcnYyLAO1E0jasWk71t1YoY5HFY8gzhGJyCTvQTivnHMzvLfEAsLL2kPvsTtC2QCuHjkWOVqczenWhlo72LF4Xc9DXKRweN9tqTY8pqESotPcjf8pJi+obC2EoG3sVTQCtukIj8t1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=LzZfPMGx; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="LzZfPMGx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1725002243; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=z9tmHWTbY/EZjhgw7CLORCHr65K3dDaVhrR+s/Ls9Jk=; b=LzZfPMGxd0TBz7gxcLeHYQAhim23NUIitBmUe+7vsFOIvan69sSXV5Tu+aql7s0cMeivwfjxk4f0Tq0n2dDriaHxV3UJAUYICsvwz/rtFBnkRVbxuUq8ulAizMBh1Z+2eOU+lJhSu486RFg7Se3U8xEdXEhED519gdzLq9NW3AI= Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0WDvwH7j_1725002234) by smtp.aliyun-inc.com; Fri, 30 Aug 2024 15:17:23 +0800 From: Jiapeng Chong To: tytso@mit.edu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH -next] ext4: Simplify if condition Date: Fri, 30 Aug 2024 15:17:13 +0800 Message-Id: <20240830071713.40565-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=3D9837 Signed-off-by: Jiapeng Chong Reviewed-by: Jan Kara --- fs/ext4/fast_commit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index 326c16a4e51e..53a77172dc9f 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -357,9 +357,7 @@ void ext4_fc_mark_ineligible(struct super_block *sb, in= t reason, handle_t *handl } spin_lock(&sbi->s_fc_lock); is_ineligible =3D 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_ineligibl= e_tid))) sbi->s_fc_ineligible_tid =3D tid; ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE); spin_unlock(&sbi->s_fc_lock); --=20 2.32.0.3.g01195cf9f