Commit 17d7648d authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: fix compile warning

This patch fixes below compile warning reported by LKP
(kernel test robot)

cppcheck warnings: (new ones prefixed by >>)

>> fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit]
    return err;
           ^
   fs/f2fs/file.c:753:6: note: first condition
    if (err)
        ^
   fs/f2fs/file.c:761:9: note: second condition
    return err;
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2e9b2bb2
...@@ -753,11 +753,14 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) ...@@ -753,11 +753,14 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
return err; return err;
#ifdef CONFIG_F2FS_FS_COMPRESSION #ifdef CONFIG_F2FS_FS_COMPRESSION
if (from != free_from) if (from != free_from) {
err = f2fs_truncate_partial_cluster(inode, from, lock); err = f2fs_truncate_partial_cluster(inode, from, lock);
if (err)
return err;
}
#endif #endif
return err; return 0;
} }
int f2fs_truncate(struct inode *inode) int f2fs_truncate(struct inode *inode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment