[PATCH] fs: jffs2: Remove always true test

Andrew Goodbody andrew.goodbody at linaro.org
Thu Oct 2 11:29:14 CEST 2025


Testing an unsigned variable to be >= 0 will always be true so remove
this redundant test.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 fs/jffs2/jffs2_1pass.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index b5f74d65017a08615db25762b41296a172bc9563..137a9585b0b73cd8e4bb19d7799a54bcf66a359d 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -994,14 +994,12 @@ jffs2_1pass_list_inodes(struct b_lists * pL, u32 pino)
 				}
 			}
 
-			if (i_version >= 0) {
-				if (jDir->type == DT_LNK)
-					jNode = get_node_mem(i_offset, NULL);
-				else
-					jNode = get_fl_mem(i_offset,
-							   sizeof(*jNode),
-							   NULL);
-			}
+			if (jDir->type == DT_LNK)
+				jNode = get_node_mem(i_offset, NULL);
+			else
+				jNode = get_fl_mem(i_offset,
+						   sizeof(*jNode),
+						   NULL);
 
 			dump_inode(pL, jDir, jNode);
 			put_fl_mem(jNode, NULL);

---
base-commit: da47ddebd16a7e1047da8537fbf01558d2a89fcf
change-id: 20251002-fs_jffs2-30b377aaf44f

Best regards,
-- 
Andrew Goodbody <andrew.goodbody at linaro.org>



More information about the U-Boot mailing list