[vfs:untested.iov_iter 18/20] lib/iov_iter.c:888:5: warning: comparison of distinct pointer types ('typeof (bytes) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *'))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git untested.iov_iter
head:   6f93d60e7f3ad21d736f87da237fb85caada4d48
commit: 0e3ec7573828ebede159c74ca0019b33ae16f348 [18/20] teach copy_page_to_iter() to handle compound pages
config: arm-randconfig-r006-20210430 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8f5a2a5836cc8e4c1def2bdeb022e7b496623439)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?id=0e3ec7573828ebede159c74ca0019b33ae16f348
        git remote add vfs https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git
        git fetch --no-tags vfs untested.iov_iter
        git checkout 0e3ec7573828ebede159c74ca0019b33ae16f348
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> lib/iov_iter.c:888:5: warning: comparison of distinct pointer types ('typeof (bytes) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
                                   min(bytes, PAGE_SIZE - offset), i);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:51:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:42:24: note: expanded from macro '__careful_cmp'
           __builtin_choose_expr(__safe_cmp(x, y), \
                                 ^~~~~~~~~~~~~~~~
   include/linux/minmax.h:32:4: note: expanded from macro '__safe_cmp'
                   (__typecheck(x, y) && __no_side_effects(x, y))
                    ^~~~~~~~~~~~~~~~~
   include/linux/minmax.h:18:28: note: expanded from macro '__typecheck'
           (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                      ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.


vim +888 lib/iov_iter.c

   877	
   878	size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
   879				 struct iov_iter *i)
   880	{
   881		size_t res = 0;
   882		if (unlikely(!page_copy_sane(page, offset, bytes)))
   883			return 0;
   884		page += offset / PAGE_SIZE; // first subpage
   885		offset %= PAGE_SIZE;
   886		while (1) {
   887			size_t n = __copy_page_to_iter(page, offset,
 > 888					min(bytes, PAGE_SIZE - offset), i);
   889			res += n;
   890			bytes -= n;
   891			if (!bytes || !n)
   892				break;
   893			offset += n;
   894			if (offset == PAGE_SIZE) {
   895				page++;
   896				offset = 0;
   897			}
   898		}
   899		return res;
   900	}
   901	EXPORT_SYMBOL(copy_page_to_iter);
   902	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux