lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202110190632.wDoZHDGH-lkp@intel.com>
Date:   Tue, 19 Oct 2021 06:11:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luis Chamberlain <mcgrof@...nel.org>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [mcgrof-next:20211011-for-axboe-add-disk-error-handling 24/24]
 drivers/nvdimm/pmem.c:535:2: warning: ignoring return value of function
 declared with 'warn_unused_result' attribute

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211011-for-axboe-add-disk-error-handling
head:   53099761729ca16d3bb36db8a8cc526f4eb08f28
commit: 53099761729ca16d3bb36db8a8cc526f4eb08f28 [24/24] block: add __must_check for *add_disk*() callers
config: x86_64-randconfig-r035-20211019 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/mcgrof/linux-next.git/commit/?id=53099761729ca16d3bb36db8a8cc526f4eb08f28
        git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
        git fetch --no-tags mcgrof-next 20211011-for-axboe-add-disk-error-handling
        git checkout 53099761729ca16d3bb36db8a8cc526f4eb08f28
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/nvdimm/pmem.c:535:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
           device_add_disk(dev, disk, pmem_attribute_groups);
           ^~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +/warn_unused_result +535 drivers/nvdimm/pmem.c

1e240e8d4a7d92 drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  412  
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  413  static int pmem_attach_disk(struct device *dev,
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  414  		struct nd_namespace_common *ndns)
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  415  {
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  416  	struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
f284a4f23752d0 drivers/nvdimm/pmem.c Dan Williams      2016-07-07  417  	struct nd_region *nd_region = to_nd_region(dev->parent);
ce7f11a230d5b7 drivers/nvdimm/pmem.c Ross Zwisler      2018-06-06  418  	int nid = dev_to_node(dev), fua;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  419  	struct resource *res = &nsio->res;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  420  	struct range bb_range;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  421  	struct nd_pfn *nd_pfn = NULL;
c1d6e828a35df5 drivers/nvdimm/pmem.c Dan Williams      2017-01-24  422  	struct dax_device *dax_dev;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  423  	struct nd_pfn_sb *pfn_sb;
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  424  	struct pmem_device *pmem;
468ded03c07e0f drivers/nvdimm/pmem.c Dan Williams      2016-01-15  425  	struct request_queue *q;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  426  	struct gendisk *disk;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  427  	void *addr;
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  428  	int rc;
fefc1d97fa4b5e drivers/nvdimm/pmem.c Pankaj Gupta      2019-07-05  429  	unsigned long flags = 0UL;
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  430  
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  431  	pmem = devm_kzalloc(dev, sizeof(*pmem), GFP_KERNEL);
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  432  	if (!pmem)
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  433  		return -ENOMEM;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  434  
8f4b01fcded2dc drivers/nvdimm/pmem.c Aneesh Kumar K.V  2019-10-31  435  	rc = devm_namespace_enable(dev, ndns, nd_info_block_reserve());
8f4b01fcded2dc drivers/nvdimm/pmem.c Aneesh Kumar K.V  2019-10-31  436  	if (rc)
8f4b01fcded2dc drivers/nvdimm/pmem.c Aneesh Kumar K.V  2019-10-31  437  		return rc;
8f4b01fcded2dc drivers/nvdimm/pmem.c Aneesh Kumar K.V  2019-10-31  438  
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  439  	/* while nsio_rw_bytes is active, parse a pfn info block if present */
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  440  	if (is_nd_pfn(dev)) {
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  441  		nd_pfn = to_nd_pfn(dev);
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  442  		rc = nvdimm_setup_pfn(nd_pfn, &pmem->pgmap);
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  443  		if (rc)
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  444  			return rc;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  445  	}
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  446  
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  447  	/* we're attaching a block device, disable raw namespace access */
8f4b01fcded2dc drivers/nvdimm/pmem.c Aneesh Kumar K.V  2019-10-31  448  	devm_namespace_disable(dev, ndns);
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  449  
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  450  	dev_set_drvdata(dev, pmem);
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  451  	pmem->phys_addr = res->start;
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  452  	pmem->size = resource_size(res);
0b277961f4484f drivers/nvdimm/pmem.c Dan Williams      2017-06-09  453  	fua = nvdimm_has_flush(nd_region);
0b277961f4484f drivers/nvdimm/pmem.c Dan Williams      2017-06-09  454  	if (!IS_ENABLED(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) || fua < 0) {
61031952f4c89d drivers/nvdimm/pmem.c Ross Zwisler      2015-06-25  455  		dev_warn(dev, "unable to guarantee persistence of writes\n");
0b277961f4484f drivers/nvdimm/pmem.c Dan Williams      2017-06-09  456  		fua = 0;
0b277961f4484f drivers/nvdimm/pmem.c Dan Williams      2017-06-09  457  	}
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  458  
947df02d255a6a drivers/nvdimm/pmem.c Dan Williams      2016-03-21  459  	if (!devm_request_mem_region(dev, res->start, resource_size(res),
450c6633e874c4 drivers/nvdimm/pmem.c Dan Williams      2016-11-28  460  				dev_name(&ndns->dev))) {
947df02d255a6a drivers/nvdimm/pmem.c Dan Williams      2016-03-21  461  		dev_warn(dev, "could not reserve region %pR\n", res);
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  462  		return -EBUSY;
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  463  	}
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  464  
87eb73b2ca7c1b drivers/nvdimm/pmem.c Christoph Hellwig 2021-05-21  465  	disk = blk_alloc_disk(nid);
87eb73b2ca7c1b drivers/nvdimm/pmem.c Christoph Hellwig 2021-05-21  466  	if (!disk)
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  467  		return -ENOMEM;
87eb73b2ca7c1b drivers/nvdimm/pmem.c Christoph Hellwig 2021-05-21  468  	q = disk->queue;
468ded03c07e0f drivers/nvdimm/pmem.c Dan Williams      2016-01-15  469  
87eb73b2ca7c1b drivers/nvdimm/pmem.c Christoph Hellwig 2021-05-21  470  	pmem->disk = disk;
a624eb520390ce drivers/nvdimm/pmem.c Dan Williams      2021-06-07  471  	pmem->pgmap.owner = pmem;
34c0fd540e79fb drivers/nvdimm/pmem.c Dan Williams      2016-01-15  472  	pmem->pfn_flags = PFN_DEV;
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  473  	pmem->pgmap.ref = &q->q_usage_counter;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  474  	if (is_nd_pfn(dev)) {
f6a55e1a3fe6b3 drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  475  		pmem->pgmap.type = MEMORY_DEVICE_FS_DAX;
f6a55e1a3fe6b3 drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  476  		pmem->pgmap.ops = &fsdax_pagemap_ops;
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  477  		addr = devm_memremap_pages(dev, &pmem->pgmap);
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  478  		pfn_sb = nd_pfn->pfn_sb;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  479  		pmem->data_offset = le64_to_cpu(pfn_sb->dataoff);
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  480  		pmem->pfn_pad = resource_size(res) -
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  481  			range_len(&pmem->pgmap.range);
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  482  		pmem->pfn_flags |= PFN_MAP;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  483  		bb_range = pmem->pgmap.range;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  484  		bb_range.start += pmem->data_offset;
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  485  	} else if (pmem_should_map_pages(dev)) {
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  486  		pmem->pgmap.range.start = res->start;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  487  		pmem->pgmap.range.end = res->end;
b7b3c01b191596 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  488  		pmem->pgmap.nr_range = 1;
f6a55e1a3fe6b3 drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  489  		pmem->pgmap.type = MEMORY_DEVICE_FS_DAX;
f6a55e1a3fe6b3 drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  490  		pmem->pgmap.ops = &fsdax_pagemap_ops;
e8d5134833006a drivers/nvdimm/pmem.c Christoph Hellwig 2017-12-29  491  		addr = devm_memremap_pages(dev, &pmem->pgmap);
34c0fd540e79fb drivers/nvdimm/pmem.c Dan Williams      2016-01-15  492  		pmem->pfn_flags |= PFN_MAP;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  493  		bb_range = pmem->pgmap.range;
91ed7ac444ef74 drivers/nvdimm/pmem.c Dan Williams      2018-10-04  494  	} else {
32b2397c1e56f3 drivers/nvdimm/pmem.c sumiyawang        2021-08-22  495  		addr = devm_memremap(dev, pmem->phys_addr,
32b2397c1e56f3 drivers/nvdimm/pmem.c sumiyawang        2021-08-22  496  				pmem->size, ARCH_MEMREMAP_PMEM);
50f44ee7248ad2 drivers/nvdimm/pmem.c Dan Williams      2019-06-13  497  		if (devm_add_action_or_reset(dev, pmem_release_queue,
d8668bb0451c3c drivers/nvdimm/pmem.c Christoph Hellwig 2019-06-26  498  					&pmem->pgmap))
50f44ee7248ad2 drivers/nvdimm/pmem.c Dan Williams      2019-06-13  499  			return -ENOMEM;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  500  		bb_range.start =  res->start;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  501  		bb_range.end = res->end;
91ed7ac444ef74 drivers/nvdimm/pmem.c Dan Williams      2018-10-04  502  	}
b36f47617f6ce7 drivers/nvdimm/pmem.c Dan Williams      2015-09-15  503  
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  504  	if (IS_ERR(addr))
200c79da824c97 drivers/nvdimm/pmem.c Dan Williams      2016-03-22  505  		return PTR_ERR(addr);
7a9eb206663177 drivers/nvdimm/pmem.c Dan Williams      2016-06-03  506  	pmem->virt_addr = addr;
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  507  
ce7f11a230d5b7 drivers/nvdimm/pmem.c Ross Zwisler      2018-06-06  508  	blk_queue_write_cache(q, true, fua);
5a92289f41311a drivers/nvdimm/pmem.c Dan Williams      2016-03-21  509  	blk_queue_physical_block_size(q, PAGE_SIZE);
f979b13c3cc515 drivers/nvdimm/pmem.c Dan Williams      2017-06-04  510  	blk_queue_logical_block_size(q, pmem_sector_size(ndns));
5a92289f41311a drivers/nvdimm/pmem.c Dan Williams      2016-03-21  511  	blk_queue_max_hw_sectors(q, UINT_MAX);
8b904b5b6b58b9 drivers/nvdimm/pmem.c Bart Van Assche   2018-03-07  512  	blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
4557641b4c7046 drivers/nvdimm/pmem.c Ross Zwisler      2018-06-26  513  	if (pmem->pfn_flags & PFN_MAP)
8b904b5b6b58b9 drivers/nvdimm/pmem.c Bart Van Assche   2018-03-07  514  		blk_queue_flag_set(QUEUE_FLAG_DAX, q);
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  515  
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  516  	disk->fops		= &pmem_fops;
6ec26b8b2d70b4 drivers/nvdimm/pmem.c Christoph Hellwig 2020-05-08  517  	disk->private_data	= pmem;
5212e11fde4d40 drivers/nvdimm/pmem.c Vishal Verma      2015-06-25  518  	nvdimm_namespace_disk_name(ndns, disk->disk_name);
cfe30b872058f2 drivers/nvdimm/pmem.c Dan Williams      2016-03-03  519  	set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
cfe30b872058f2 drivers/nvdimm/pmem.c Dan Williams      2016-03-03  520  			/ 512);
b95f5f4391fad6 drivers/nvdimm/pmem.c Dan Williams      2016-01-04  521  	if (devm_init_badblocks(dev, &pmem->bb))
b95f5f4391fad6 drivers/nvdimm/pmem.c Dan Williams      2016-01-04  522  		return -ENOMEM;
a4574f63edc6f7 drivers/nvdimm/pmem.c Dan Williams      2020-10-13  523  	nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range);
57f7f317abdd07 drivers/nvdimm/pmem.c Dan Williams      2016-01-06  524  	disk->bb = &pmem->bb;
f02716db951c5e drivers/nvdimm/pmem.c Dan Williams      2016-06-15  525  
fefc1d97fa4b5e drivers/nvdimm/pmem.c Pankaj Gupta      2019-07-05  526  	if (is_nvdimm_sync(nd_region))
fefc1d97fa4b5e drivers/nvdimm/pmem.c Pankaj Gupta      2019-07-05  527  		flags = DAXDEV_F_SYNC;
fefc1d97fa4b5e drivers/nvdimm/pmem.c Pankaj Gupta      2019-07-05  528  	dax_dev = alloc_dax(pmem, disk->disk_name, &pmem_dax_ops, flags);
4e4ced93794acb drivers/nvdimm/pmem.c Vivek Goyal       2020-04-01  529  	if (IS_ERR(dax_dev)) {
4e4ced93794acb drivers/nvdimm/pmem.c Vivek Goyal       2020-04-01  530  		return PTR_ERR(dax_dev);
c1d6e828a35df5 drivers/nvdimm/pmem.c Dan Williams      2017-01-24  531  	}
ce7f11a230d5b7 drivers/nvdimm/pmem.c Ross Zwisler      2018-06-06  532  	dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
c1d6e828a35df5 drivers/nvdimm/pmem.c Dan Williams      2017-01-24  533  	pmem->dax_dev = dax_dev;
6e0c90d691cd5d drivers/nvdimm/pmem.c Dan Williams      2017-06-26  534  
d55174cccac2e4 drivers/nvdimm/pmem.c Christoph Hellwig 2021-09-22 @535  	device_add_disk(dev, disk, pmem_attribute_groups);
c1d6e828a35df5 drivers/nvdimm/pmem.c Dan Williams      2017-01-24  536  	if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
f02716db951c5e drivers/nvdimm/pmem.c Dan Williams      2016-06-15  537  		return -ENOMEM;
f02716db951c5e drivers/nvdimm/pmem.c Dan Williams      2016-06-15  538  
32f61d67570db0 drivers/nvdimm/pmem.c Christoph Hellwig 2020-09-01  539  	nvdimm_check_and_set_ro(disk);
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  540  
975750a98c2676 drivers/nvdimm/pmem.c Toshi Kani        2017-06-12  541  	pmem->bb_state = sysfs_get_dirent(disk_to_dev(disk)->kobj.sd,
975750a98c2676 drivers/nvdimm/pmem.c Toshi Kani        2017-06-12  542  					  "badblocks");
6aa734a2f38e2e drivers/nvdimm/pmem.c Dan Williams      2017-06-30  543  	if (!pmem->bb_state)
6aa734a2f38e2e drivers/nvdimm/pmem.c Dan Williams      2017-06-30  544  		dev_warn(dev, "'badblocks' notification disabled\n");
975750a98c2676 drivers/nvdimm/pmem.c Toshi Kani        2017-06-12  545  
8c2f7e8658df1d drivers/nvdimm/pmem.c Dan Williams      2015-06-25  546  	return 0;
8c2f7e8658df1d drivers/nvdimm/pmem.c Dan Williams      2015-06-25  547  }
9e853f2313e5eb drivers/block/pmem.c  Ross Zwisler      2015-04-01  548  

:::::: The code at line 535 was first introduced by commit
:::::: d55174cccac2e4c2a58ff68b6b573fc0836f73bd nvdimm/pmem: fix creating the dax group

:::::: TO: Christoph Hellwig <hch@....de>
:::::: CC: Dan Williams <dan.j.williams@...el.com>

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

Download attachment ".config.gz" of type "application/gzip" (38256 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ