public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected], [email protected],
	GNU/Weeb Mailing List <[email protected]>,
	[email protected]
Subject: [ammarfaizi2-block:dhowells/linux-fs/cifs-netfs 40/41] fs/netfs/io.c:596:15: warning: variable 'ix' set but not used
Date: Tue, 31 May 2022 04:38:37 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/cifs-netfs
head:   1fc71b6b30f6d2a981c163b77c9aee0aecaecb29
commit: 4efb4efb053eca8b1e75a9242112e8e159baab68 [40/41] fixes
config: x86_64-randconfig-a011-20220530 (https://download.01.org/0day-ci/archive/20220531/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0776c48f9b7e69fa447bee57c7c0985caa856be9)
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
        # https://github.com/ammarfaizi2/linux-block/commit/4efb4efb053eca8b1e75a9242112e8e159baab68
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/cifs-netfs
        git checkout 4efb4efb053eca8b1e75a9242112e8e159baab68
        # 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=x86_64 SHELL=/bin/bash fs/netfs/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> fs/netfs/io.c:596:15: warning: variable 'ix' set but not used [-Wunused-but-set-variable]
           unsigned int ix = 0, nsegs = 0;
                        ^
   1 warning generated.


vim +/ix +596 fs/netfs/io.c

   586	
   587	/*
   588	 * Select the span of an xarray iterator we're going to use.  Limit it by both
   589	 * maximum size and maximum number of segments.  It is assumed that segments
   590	 * can be larger than a page in size, provided they're physically contiguous.
   591	 */
   592	static size_t netfs_limit_xarray(struct iov_iter *iter, size_t start_offset,
   593					 size_t max_size, size_t max_segs)
   594	{
   595		struct folio *folio;
 > 596		unsigned int ix = 0, nsegs = 0;
   597		loff_t pos = iter->xarray_start + iter->iov_offset;
   598		pgoff_t index = pos / PAGE_SIZE;
   599		size_t span = 0, n = iter->count;
   600	
   601		XA_STATE(xas, iter->xarray, index);
   602	
   603		if (WARN_ON(!iov_iter_is_xarray(iter)) ||
   604		    WARN_ON(start_offset > n) ||
   605		    n == 0)
   606			return 0;
   607		max_size = min(max_size, n - start_offset);
   608	
   609		rcu_read_lock();
   610		xas_for_each(&xas, folio, ULONG_MAX) {
   611			size_t offset, flen, len;
   612			if (xas_retry(&xas, folio))
   613				continue;
   614			if (WARN_ON(xa_is_value(folio)))
   615				break;
   616			if (WARN_ON(folio_test_hugetlb(folio)))
   617				break;
   618	
   619			flen = folio_size(folio);
   620			offset = offset_in_folio(folio, pos);
   621			len = min(max_size, flen - offset);
   622			span += len;
   623			nsegs++;
   624			ix++;
   625			if (span >= max_size || nsegs >= max_segs)
   626				break;
   627		}
   628	
   629		rcu_read_unlock();
   630		return min(span, max_size);
   631	}
   632	

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

                 reply	other threads:[~2022-05-30 20:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox