* [ammarfaizi2-block:dhowells/linux-fs/cifs-netfs 40/41] fs/netfs/io.c:596:15: warning: variable 'ix' set but not used
@ 2022-05-30 20:38 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-05-30 20:38 UTC (permalink / raw)
To: David Howells; +Cc: llvm, kbuild-all, GNU/Weeb Mailing List, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-30 20:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-30 20:38 [ammarfaizi2-block:dhowells/linux-fs/cifs-netfs 40/41] fs/netfs/io.c:596:15: warning: variable 'ix' set but not used 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