[linux-next:master 2810/2998] drivers/dax/device.c:111:21: warning: variable 'dax_region' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
commit: 7ad229c3dd07d91e827d59d3c2fc1ac7918e8634 [2810/2998] device-dax: make align a per-device property
config: i386-randconfig-s002-20200825 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        git checkout 7ad229c3dd07d91e827d59d3c2fc1ac7918e8634
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/dax/device.c: In function '__dev_dax_pmd_fault':
>> drivers/dax/device.c:111:21: warning: variable 'dax_region' set but not used [-Wunused-but-set-variable]
     111 |  struct dax_region *dax_region;
         |                     ^~~~~~~~~~
   drivers/dax/device.c: At top level:
   drivers/dax/device.c:395:5: warning: no previous prototype for 'dev_dax_probe' [-Wmissing-prototypes]
     395 | int dev_dax_probe(struct dev_dax *dev_dax)
         |     ^~~~~~~~~~~~~

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=7ad229c3dd07d91e827d59d3c2fc1ac7918e8634
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 7ad229c3dd07d91e827d59d3c2fc1ac7918e8634
vim +/dax_region +111 drivers/dax/device.c

dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  105  
226ab561075f6f drivers/dax/device.c Dan Williams 2018-07-13  106  static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
2232c6382a453d drivers/dax/device.c Dan Williams 2018-07-13  107  				struct vm_fault *vmf, pfn_t *pfn)
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  108  {
d8a849e1bc1237 drivers/dax/dax.c    Dave Jiang   2017-02-22  109  	unsigned long pmd_addr = vmf->address & PMD_MASK;
5f0694b300b9fb drivers/dax/dax.c    Dan Williams 2017-01-30  110  	struct device *dev = &dev_dax->dev;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14 @111  	struct dax_region *dax_region;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  112  	phys_addr_t phys;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  113  	pgoff_t pgoff;
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  114  	unsigned int fault_size = PMD_SIZE;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  115  
5f0694b300b9fb drivers/dax/dax.c    Dan Williams 2017-01-30  116  	if (check_vma(dev_dax, vmf->vma, __func__))
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  117  		return VM_FAULT_SIGBUS;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  118  
5f0694b300b9fb drivers/dax/dax.c    Dan Williams 2017-01-30  119  	dax_region = dev_dax->region;
7ad229c3dd07d9 drivers/dax/device.c Joao Martins 2020-08-25  120  	if (dev_dax->align > PMD_SIZE) {
6daaca522ab464 drivers/dax/device.c Dan Williams 2018-03-05  121  		dev_dbg(dev, "alignment (%#x) > fault size (%#x)\n",
7ad229c3dd07d9 drivers/dax/device.c Joao Martins 2020-08-25  122  			dev_dax->align, fault_size);
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  123  		return VM_FAULT_SIGBUS;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  124  	}
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  125  
7ad229c3dd07d9 drivers/dax/device.c Joao Martins 2020-08-25  126  	if (fault_size < dev_dax->align)
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  127  		return VM_FAULT_SIGBUS;
7ad229c3dd07d9 drivers/dax/device.c Joao Martins 2020-08-25  128  	else if (fault_size > dev_dax->align)
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  129  		return VM_FAULT_FALLBACK;
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  130  
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  131  	/* if we are outside of the VMA */
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  132  	if (pmd_addr < vmf->vma->vm_start ||
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  133  			(pmd_addr + PMD_SIZE) > vmf->vma->vm_end)
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  134  		return VM_FAULT_SIGBUS;
0134ed4fb9e786 drivers/dax/dax.c    Dave Jiang   2017-03-10  135  
f42003917b4569 drivers/dax/dax.c    Dave Jiang   2017-02-22  136  	pgoff = linear_page_index(vmf->vma, pmd_addr);
736163671bcb16 drivers/dax/device.c Dan Williams 2017-05-04  137  	phys = dax_pgoff_to_phys(dev_dax, pgoff, PMD_SIZE);
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  138  	if (phys == -1) {
6daaca522ab464 drivers/dax/device.c Dan Williams 2018-03-05  139  		dev_dbg(dev, "pgoff_to_phys(%#lx) failed\n", pgoff);
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  140  		return VM_FAULT_SIGBUS;
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  141  	}
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  142  
79541c848bbd09 drivers/dax/device.c Dan Williams 2020-08-25  143  	*pfn = phys_to_pfn_t(phys, PFN_DEV|PFN_MAP);
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  144  
fce86ff5802bac drivers/dax/device.c Dan Williams 2019-05-13  145  	return vmf_insert_pfn_pmd(vmf, *pfn, vmf->flags & FAULT_FLAG_WRITE);
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  146  }
dee410792419aa drivers/dax/dax.c    Dan Williams 2016-05-14  147  

:::::: The code at line 111 was first introduced by commit
:::::: dee410792419aaa8bc3e3b35d2ccb6515835916d /dev/dax, core: file operations and dax-mmap

:::::: TO: Dan Williams <dan.j.williams@xxxxxxxxx>
:::::: CC: Dan Williams <dan.j.williams@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux