fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false
From: kernel test robot
Date: Sun Aug 09 2020 - 08:13:25 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06a81c1c7db9bd5de0bd38cd5acc44bb22b99150
commit: 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef f2fs: support partial truncation on compressed inode
date: 3 months ago
compiler: xtensa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
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;
^
>> fs/f2fs/file.c:1689:12: warning: Variable 'new_size' is reassigned a value before the old one has been used. [redundantAssignment]
new_size = (last_off == pg_end) ? offset + len :
^
fs/f2fs/file.c:1620:0: note: Variable 'new_size' is reassigned a value before the old one has been used.
loff_t new_size = i_size_read(inode);
^
fs/f2fs/file.c:1689:12: note: Variable 'new_size' is reassigned a value before the old one has been used.
new_size = (last_off == pg_end) ? offset + len :
^
>> fs/f2fs/file.c:2789:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = -EINVAL;
^
fs/f2fs/file.c:2784:7: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = -EBUSY;
^
fs/f2fs/file.c:2789:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = -EINVAL;
^
fs/f2fs/file.c:2811:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = f2fs_convert_inline_inode(src);
^
fs/f2fs/file.c:2789:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = -EINVAL;
^
fs/f2fs/file.c:2811:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = f2fs_convert_inline_inode(src);
^
fs/f2fs/file.c:2840:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = __exchange_data_block(src, dst, pos_in >> F2FS_BLKSIZE_BITS,
^
fs/f2fs/file.c:2834:7: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = -EBUSY;
^
fs/f2fs/file.c:2840:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = __exchange_data_block(src, dst, pos_in >> F2FS_BLKSIZE_BITS,
^
fs/f2fs/f2fs.h:2209:15: warning: Local variable valid_node_count shadows outer function [shadowFunction]
unsigned int valid_node_count, user_block_count;
^
fs/f2fs/f2fs.h:2305:28: note: Shadowed declaration
static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
^
fs/f2fs/f2fs.h:2209:15: note: Shadow variable
unsigned int valid_node_count, user_block_count;
^
vim +/err +761 fs/f2fs/file.c
760
> 761 return err;
762 }
763
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx