[dhowells-fs:fscache-iter 35/55] fs/cachefiles/io.c:371:27: warning: variable 'cache' set but not used

From: kernel test robot
Date: Sun Aug 01 2021 - 04:53:24 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-iter
head: 47585048b7ec10d66ca6c102b468b9b362910475
commit: c560d97274dfacbe0101a06240a1d22fb0763fa1 [35/55] cachefiles: Implement read and write parts of new I/O API
config: arc-buildonly-randconfig-r006-20210801 (attached as .config)
compiler: arceb-elf-gcc (GCC) 10.3.0
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://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=c560d97274dfacbe0101a06240a1d22fb0763fa1
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs fscache-iter
git checkout c560d97274dfacbe0101a06240a1d22fb0763fa1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc

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

All warnings (new ones prefixed by >>):

fs/cachefiles/io.c: In function 'cachefiles_begin_operation':
>> fs/cachefiles/io.c:371:27: warning: variable 'cache' set but not used [-Wunused-but-set-variable]
371 | struct cachefiles_cache *cache;
| ^~~~~


vim +/cache +371 fs/cachefiles/io.c

61ea886d763ce80 David Howells 2020-02-06 364
26aaeffcafe6cbb David Howells 2021-02-22 365 /*
26aaeffcafe6cbb David Howells 2021-02-22 366 * Open the cache file when beginning a cache operation.
26aaeffcafe6cbb David Howells 2021-02-22 367 */
e3f113683fd3fd8 David Howells 2020-02-06 368 int cachefiles_begin_operation(struct netfs_cache_resources *cres)
26aaeffcafe6cbb David Howells 2021-02-22 369 {
e3f113683fd3fd8 David Howells 2020-02-06 370 struct cachefiles_object *object = cachefiles_cres_object(cres);
26aaeffcafe6cbb David Howells 2021-02-22 @371 struct cachefiles_cache *cache;
c560d97274dfacb David Howells 2020-02-06 372 //struct path path;
26aaeffcafe6cbb David Howells 2021-02-22 373 struct file *file;
26aaeffcafe6cbb David Howells 2021-02-22 374
26aaeffcafe6cbb David Howells 2021-02-22 375 _enter("");
26aaeffcafe6cbb David Howells 2021-02-22 376
26aaeffcafe6cbb David Howells 2021-02-22 377 cache = container_of(object->fscache.cache,
26aaeffcafe6cbb David Howells 2021-02-22 378 struct cachefiles_cache, cache);
26aaeffcafe6cbb David Howells 2021-02-22 379

:::::: The code at line 371 was first introduced by commit
:::::: 26aaeffcafe6cbb7c3978fa6ed7555122f8c9f8c fscache, cachefiles: Add alternate API to use kiocb for read/write to cache

:::::: TO: David Howells <dhowells@xxxxxxxxxx>
:::::: CC: David Howells <dhowells@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip