All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false
@ 2020-08-09 12:10 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-08-09 12:10 UTC (permalink / raw)
  To: Chao Yu, Chao Yu; +Cc: kbuild-all, linux-kernel, Jaegeuk Kim

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@intel.com>


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@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false
@ 2020-08-09 12:10 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-08-09 12:10 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3437 bytes --]

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@intel.com>


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(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-09 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-09 12:10 fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false kernel test robot
2020-08-09 12:10 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.