[PATCH v3 1/4] erofs-utils: lib: remove redundant if check

Lucas Karpinski <[email protected]>
Newsgroups org.ozlabs.lists.linux-erofs
Message-ID <[email protected]>
Remove the if check since erofs_set_inode_fingerprint is already protected
by the same if statement.

Signed-off-by: Lucas Karpinski <[email protected]>
---
 lib/inode.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/inode.c b/lib/inode.c
index c932981a..2f78d9b8 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -2018,11 +2018,9 @@ static int erofs_mkfs_begin_nondirectory(const struct erofs_mkfs_btctx *btctx,
 			goto out;
 		}
 
-		if (S_ISREG(inode->i_mode) && inode->i_size) {
-			ret = erofs_set_inode_fingerprint(inode, ctx.fd, ctx.fpos);
-			if (ret < 0)
-				return ret;
-		}
+		ret = erofs_set_inode_fingerprint(inode, ctx.fd, ctx.fpos);
+		if (ret < 0)
+			return ret;
 
 		if (inode->sbi->available_compr_algs &&
 		    erofs_file_is_compressible(im, inode)) {

-- 
Git-155)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.