All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [djwong-xfs:djwong-wtf 332/340] fs/xfs/xfs_bmap_util.c:1718:6: warning: Condition 'ret' is always false [knownConditionTrueFalse]
@ 2020-04-13  5:53 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-04-13  5:53 UTC (permalink / raw
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git djwong-wtf
head:   451e129b1d48285f45c3abcced1f7fe3516aa645
commit: fdefacbc10af711cb7c43bf3014d5cc8d7a1b84e [332/340] xfs: add a ->swap_file_range handler

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

   fs/xfs/xfs_bmap_util.c:387:44: warning: Identical condition 'iflags&BMV_IF_COWFORK', second condition is always false [identicalConditionAfterEarlyExit]
    if ((iflags & BMV_IF_ATTRFORK) && (iflags & BMV_IF_COWFORK))
                                              ^
   fs/xfs/xfs_bmap_util.c:384:13: note: If condition 'iflags&BMV_IF_COWFORK' is true, the function will return/exit
    if (iflags & BMV_IF_COWFORK)
               ^
   fs/xfs/xfs_bmap_util.c:387:44: note: Testing identical condition 'iflags&BMV_IF_COWFORK'
    if ((iflags & BMV_IF_ATTRFORK) && (iflags & BMV_IF_COWFORK))
                                              ^
   fs/xfs/xfs_bmap_util.c:658:6: warning: Condition 'error' is always false [knownConditionTrueFalse]
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:657:10: note: Assignment 'error=0', assigned value is 0
    error = xfs_qm_dqattach(ip);
            ^
   fs/xfs/xfs_bmap_util.c:658:6: note: Condition 'error' is always false
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:765:6: warning: Condition 'error' is always false [knownConditionTrueFalse]
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:764:10: note: Assignment 'error=0', assigned value is 0
    error = xfs_qm_dqattach(ip);
            ^
   fs/xfs/xfs_bmap_util.c:765:6: note: Condition 'error' is always false
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:992:6: warning: Condition 'error' is always false [knownConditionTrueFalse]
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:991:10: note: Assignment 'error=0', assigned value is 0
    error = xfs_qm_dqattach(ip);
            ^
   fs/xfs/xfs_bmap_util.c:992:6: note: Condition 'error' is always false
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:1558:6: warning: Condition 'error' is always false [knownConditionTrueFalse]
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:1557:10: note: Assignment 'error=0', assigned value is 0
    error = xfs_qm_dqattach(ip);
            ^
   fs/xfs/xfs_bmap_util.c:1558:6: note: Condition 'error' is always false
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:1562:6: warning: Condition 'error' is always false [knownConditionTrueFalse]
    if (error)
        ^
   fs/xfs/xfs_bmap_util.c:1561:10: note: Assignment 'error=0', assigned value is 0
    error = xfs_qm_dqattach(tip);
            ^
   fs/xfs/xfs_bmap_util.c:1562:6: note: Condition 'error' is always false
    if (error)
        ^
>> fs/xfs/xfs_bmap_util.c:1718:6: warning: Condition 'ret' is always false [knownConditionTrueFalse]
    if (ret)
        ^
   fs/xfs/xfs_bmap_util.c:1717:8: note: Assignment 'ret=0', assigned value is 0
    ret = xfs_qm_dqattach(ip2);
          ^
   fs/xfs/xfs_bmap_util.c:1718:6: note: Condition 'ret' is always false
    if (ret)
        ^
   fs/xfs/xfs_bmap_util.c:1721:6: warning: Condition 'ret' is always false [knownConditionTrueFalse]
    if (ret)
        ^
   fs/xfs/xfs_bmap_util.c:1720:8: note: Assignment 'ret=0', assigned value is 0
    ret = xfs_qm_dqattach(ip1);
          ^
   fs/xfs/xfs_bmap_util.c:1721:6: note: Condition 'ret' is always false
    if (ret)
        ^
   fs/xfs/xfs_bmap_util.c:1743:8: warning: The scope of the variable 'error' can be reduced. [variableScope]
    int   error;
          ^
   fs/xfs/xfs_buf.h:278:38: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
    bool wait = bp->b_flags & XBF_ASYNC ? false : true;
                                        ^
   fs/xfs/xfs_bmap_util.c:131:34: warning: Variable 'uninitialized_var' is assigned a value that is never used. [unreadVariable]
     xfs_rtblock_t uninitialized_var(rtx); /* realtime extent no */
                                    ^
   nofile:0:0: warning: Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information. [toomanyconfigs]
   
--
>> fs/xfs/xfs_file.c:1101:6: warning: Condition 'ret' is always false [knownConditionTrueFalse]
    if (ret)
        ^
   fs/xfs/xfs_file.c:1096:6: note: Assuming that condition 'ret' is not redundant
    if (ret)
        ^
   fs/xfs/xfs_file.c:1101:6: note: Condition 'ret' is always false
    if (ret)
        ^
   fs/xfs/xfs_file.c:689:12: warning: The scope of the variable 'ret' can be reduced. [variableScope]
    ssize_t   ret;
              ^
   fs/xfs/xfs_buf.h:278:38: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
    bool wait = bp->b_flags & XBF_ASYNC ? false : true;
                                        ^
   nofile:0:0: warning: Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information. [toomanyconfigs]
   

vim +/ret +1718 fs/xfs/xfs_bmap_util.c

  1696	
  1697	/* Prepare two files to have their data swapped. */
  1698	int
  1699	xfs_swap_range_prep(
  1700		struct file		*file1,
  1701		struct file		*file2,
  1702		struct file_swap_range	*fsr)
  1703	{
  1704		struct xfs_inode	*ip1 = XFS_I(file_inode(file1));
  1705		struct xfs_inode	*ip2 = XFS_I(file_inode(file2));
  1706		int			ret;
  1707	
  1708		/* Verify both files are either real-time or non-realtime */
  1709		if (XFS_IS_REALTIME_INODE(ip1) != XFS_IS_REALTIME_INODE(ip2))
  1710			return -EINVAL;
  1711	
  1712		ret = generic_swap_file_range_prep(file1, file2, fsr);
  1713		if (ret)
  1714			return ret;
  1715	
  1716		/* Attach dquots to both inodes before changing block maps. */
  1717		ret = xfs_qm_dqattach(ip2);
> 1718		if (ret)
  1719			return ret;
  1720		ret = xfs_qm_dqattach(ip1);
  1721		if (ret)
  1722			return ret;
  1723	
  1724		/* Flush the relevant ranges of both files. */
  1725		ret = xfs_flush_unmap_range(ip2, fsr->file2_offset, fsr->length);
  1726		if (ret)
  1727			return ret;
  1728		return xfs_flush_unmap_range(ip1, fsr->file1_offset, fsr->length);
  1729	}
  1730	

---
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] only message in thread

only message in thread, other threads:[~2020-04-13  5:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-13  5:53 [djwong-xfs:djwong-wtf 332/340] fs/xfs/xfs_bmap_util.c:1718:6: warning: Condition 'ret' is always false [knownConditionTrueFalse] kbuild 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.