Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()

kernel test robot <[email protected]> Sun, 28 Dec 2025 09:41:05 +0800
Newsgroups org.kernel.vger.linux-sparse,dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Vincent,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]

url:    https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base:   3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link:    https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: arm-randconfig-r071-20251224 (https://download.01.org/0day-ci/archive/20251228/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

smatch warnings:
fs/xfs/xfs_mount.c:144 xfs_sb_validate_fsb_count() warn: unsigned '*_d' is never less than zero.
fs/xfs/xfs_mount.c:144 xfs_sb_validate_fsb_count() warn: unsigned '_a' is never less than zero.

vim +144 fs/xfs/xfs_mount.c

27174203f570b9 Christoph Hellwig 2009-03-30  130  
4cc929ee305c69 Nathan Scott      2007-05-14  131  /*
4cc929ee305c69 Nathan Scott      2007-05-14  132   * Check size of device based on the (data/realtime) block count.
4cc929ee305c69 Nathan Scott      2007-05-14  133   * Note: this check is used by the growfs code as well as mount.
4cc929ee305c69 Nathan Scott      2007-05-14  134   */
4cc929ee305c69 Nathan Scott      2007-05-14  135  int
4cc929ee305c69 Nathan Scott      2007-05-14  136  xfs_sb_validate_fsb_count(
4cc929ee305c69 Nathan Scott      2007-05-14  137  	xfs_sb_t	*sbp,
c8ce540db5f67d Darrick J. Wong   2017-06-16  138  	uint64_t	nblocks)
4cc929ee305c69 Nathan Scott      2007-05-14  139  {
cebf9dacd5c3ce Pankaj Raghav     2024-08-22  140  	uint64_t		max_bytes;
cebf9dacd5c3ce Pankaj Raghav     2024-08-22  141  
4cc929ee305c69 Nathan Scott      2007-05-14  142  	ASSERT(sbp->sb_blocklog >= BBSHIFT);
4cc929ee305c69 Nathan Scott      2007-05-14  143  
cebf9dacd5c3ce Pankaj Raghav     2024-08-22 @144  	if (check_shl_overflow(nblocks, sbp->sb_blocklog, &max_bytes))
cebf9dacd5c3ce Pankaj Raghav     2024-08-22  145  		return -EFBIG;
cebf9dacd5c3ce Pankaj Raghav     2024-08-22  146  
d5cf09baced0ef Christoph Hellwig 2014-07-30  147  	/* Limited by ULONG_MAX of page cache index */
cebf9dacd5c3ce Pankaj Raghav     2024-08-22  148  	if (max_bytes >> PAGE_SHIFT > ULONG_MAX)
2451337dd04390 Dave Chinner      2014-06-25  149  		return -EFBIG;
4cc929ee305c69 Nathan Scott      2007-05-14  150  	return 0;
4cc929ee305c69 Nathan Scott      2007-05-14  151  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  152  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki