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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 15 Jun 2020 14:29:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Maxime Ripard <maxime@...no.tech>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Joerg Roedel <jroedel@...e.de>
Subject: drivers/iommu/sun50i-iommu.c:561:13: warning: variable 'pte_dma' set
 but not used

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4a87b197c1da6b16608d5110709e0b3308e25dcd
commit: 4100b8c229b328358cc4a82f5042dbf22f1c1ccb iommu: Add Allwinner H6 IOMMU driver
date:   4 weeks ago
:::::: branch date: 60 minutes ago
:::::: commit date: 4 weeks ago
config: arm-randconfig-r022-20200614 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.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
        git checkout 4100b8c229b328358cc4a82f5042dbf22f1c1ccb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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 >>, old ones prefixed by <<):

drivers/iommu/sun50i-iommu.c: In function 'sun50i_dte_get_page_table':
drivers/iommu/sun50i-iommu.c:486:16: warning: unused variable 'flags' [-Wunused-variable]
486 |  unsigned long flags;
|                ^~~~~
drivers/iommu/sun50i-iommu.c: In function 'sun50i_iommu_unmap':
>> drivers/iommu/sun50i-iommu.c:561:13: warning: variable 'pte_dma' set but not used [-Wunused-but-set-variable]
561 |  dma_addr_t pte_dma;
|             ^~~~~~~
drivers/iommu/sun50i-iommu.c:559:23: warning: unused variable 'iommu' [-Wunused-variable]
559 |  struct sun50i_iommu *iommu = sun50i_domain->iommu;
|                       ^~~~~
drivers/iommu/sun50i-iommu.c: In function 'sun50i_iommu_probe_device':
drivers/iommu/sun50i-iommu.c:749:22: warning: unused variable 'group' [-Wunused-variable]
749 |  struct iommu_group *group;
|                      ^~~~~
drivers/iommu/sun50i-iommu.c: In function 'sun50i_iommu_irq':
>> drivers/iommu/sun50i-iommu.c:890:14: warning: variable 'iova' set but not used [-Wunused-but-set-variable]
890 |  phys_addr_t iova;
|              ^~~~

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4100b8c229b328358cc4a82f5042dbf22f1c1ccb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 4100b8c229b328358cc4a82f5042dbf22f1c1ccb
vim +/pte_dma +561 drivers/iommu/sun50i-iommu.c

4100b8c229b328 Maxime Ripard 2020-05-13  554  
4100b8c229b328 Maxime Ripard 2020-05-13  555  static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova,
4100b8c229b328 Maxime Ripard 2020-05-13  556  				 size_t size, struct iommu_iotlb_gather *gather)
4100b8c229b328 Maxime Ripard 2020-05-13  557  {
4100b8c229b328 Maxime Ripard 2020-05-13  558  	struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
4100b8c229b328 Maxime Ripard 2020-05-13  559  	struct sun50i_iommu *iommu = sun50i_domain->iommu;
4100b8c229b328 Maxime Ripard 2020-05-13  560  	phys_addr_t pt_phys;
4100b8c229b328 Maxime Ripard 2020-05-13 @561  	dma_addr_t pte_dma;
4100b8c229b328 Maxime Ripard 2020-05-13  562  	u32 *pte_addr;
4100b8c229b328 Maxime Ripard 2020-05-13  563  	u32 dte;
4100b8c229b328 Maxime Ripard 2020-05-13  564  
4100b8c229b328 Maxime Ripard 2020-05-13  565  	dte = sun50i_domain->dt[sun50i_iova_get_dte_index(iova)];
4100b8c229b328 Maxime Ripard 2020-05-13  566  	if (!sun50i_dte_is_pt_valid(dte))
4100b8c229b328 Maxime Ripard 2020-05-13  567  		return 0;
4100b8c229b328 Maxime Ripard 2020-05-13  568  
4100b8c229b328 Maxime Ripard 2020-05-13  569  	pt_phys = sun50i_dte_get_pt_address(dte);
4100b8c229b328 Maxime Ripard 2020-05-13  570  	pte_addr = (u32 *)phys_to_virt(pt_phys) + sun50i_iova_get_pte_index(iova);
4100b8c229b328 Maxime Ripard 2020-05-13  571  	pte_dma = pt_phys + sun50i_iova_get_pte_index(iova) * PT_ENTRY_SIZE;
4100b8c229b328 Maxime Ripard 2020-05-13  572  
4100b8c229b328 Maxime Ripard 2020-05-13  573  	if (!sun50i_pte_is_page_valid(*pte_addr))
4100b8c229b328 Maxime Ripard 2020-05-13  574  		return 0;
4100b8c229b328 Maxime Ripard 2020-05-13  575  
4100b8c229b328 Maxime Ripard 2020-05-13  576  	memset(pte_addr, 0, sizeof(*pte_addr));
4100b8c229b328 Maxime Ripard 2020-05-13  577  	sun50i_table_flush(sun50i_domain, pte_addr, 1);
4100b8c229b328 Maxime Ripard 2020-05-13  578  
4100b8c229b328 Maxime Ripard 2020-05-13  579  	return SZ_4K;
4100b8c229b328 Maxime Ripard 2020-05-13  580  }
4100b8c229b328 Maxime Ripard 2020-05-13  581  

---
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" (33069 bytes)

_______________________________________________
kbuild mailing list -- kbuild@...ts.01.org
To unsubscribe send an email to kbuild-leave@...ts.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ