public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [RFC][PATCH] iov_iter: Add extraction functions
       [not found] <3750754.1662765490@warthog.procyon.org.uk>
@ 2022-09-10 12:16 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-09-10 12:16 UTC (permalink / raw)
  To: David Howells; +Cc: llvm, kbuild-all

Hi David,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v6.0-rc4 next-20220909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Howells/iov_iter-Add-extraction-functions/20220910-072102
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ce888220d5c7a805e0e155302a318d5d23e62950
config: s390-randconfig-r044-20220907 (https://download.01.org/0day-ci/archive/20220910/202209102009.ie6X2mlj-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 1546df49f5a6d09df78f569e4137ddb365a3e827)
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 s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/a8df8a897880379087a0a9fc4f6fc1391e352217
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review David-Howells/iov_iter-Add-extraction-functions/20220910-072102
        git checkout a8df8a897880379087a0a9fc4f6fc1391e352217
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from lib/iov_iter_extract.c:16:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from lib/iov_iter_extract.c:16:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from lib/iov_iter_extract.c:16:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> lib/iov_iter_extract.c:348:3: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
                   ret += len;
                   ^~~
   lib/iov_iter_extract.c:329:13: note: initialize the variable 'ret' to silence this warning
           ssize_t ret;
                      ^
                       = 0
   13 warnings generated.


vim +/ret +348 lib/iov_iter_extract.c

   314	
   315	/*
   316	 * Extract the pages from an XARRAY-class iterator and add them to the
   317	 * destination buffer.  The pages are not pinned.
   318	 */
   319	static ssize_t iov_iter_extract_xarray(struct iov_iter *iter,
   320					       void *array, unsigned int array_max,
   321					       ssize_t maxsize,
   322					       enum iter_extract_dest dest)
   323	{
   324		struct xarray *xa = iter->xarray;
   325		struct folio *folio;
   326		unsigned int ix;
   327		loff_t start = iter->xarray_start + iter->iov_offset;
   328		pgoff_t index = start / PAGE_SIZE;
   329		ssize_t ret;
   330		size_t offset, len;
   331		XA_STATE(xas, xa, index);
   332	
   333		rcu_read_lock();
   334		xas_for_each(&xas, folio, ULONG_MAX) {
   335			if (xas_retry(&xas, folio))
   336				continue;
   337			if (WARN_ON(xa_is_value(folio)))
   338				break;
   339			if (WARN_ON(folio_test_hugetlb(folio)))
   340				break;
   341	
   342			offset = offset_in_folio(folio, start);
   343			len = min_t(size_t, maxsize, folio_size(folio) - offset);
   344	
   345			ix = extract_contig_pages(array, folio_page(folio, 0),
   346						  offset, len, dest);
   347			maxsize -= len;
 > 348			ret += len;
   349			if (ix >= array_max) {
   350				WARN_ON_ONCE(ix > array_max);
   351				break;
   352			}
   353	
   354			if (maxsize <= 0)
   355				break;
   356		}
   357	
   358		rcu_read_unlock();
   359		terminate_array(array, dest);
   360		return ret;
   361	}
   362	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-10 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3750754.1662765490@warthog.procyon.org.uk>
2022-09-10 12:16 ` [RFC][PATCH] iov_iter: Add extraction functions kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox