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, 25 Jan 2021 11:27:15 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jiaxun Yang <jiaxun.yang@...goat.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Subject: arch/mips/pci/ops-loongson2.c:39:6: warning: variable 'dummy' set
 but not used

Hi Jiaxun,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6ee1d745b7c9fd573fba142a2efdad76a9f1cb04
commit: b13812ddea615b6507beef24f76540c0c1143c5c MIPS: Loongson2ef: Disable Loongson MMI instructions
date:   4 months ago
config: mips-randconfig-r013-20210125 (attached as .config)
compiler: mips64el-linux-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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b13812ddea615b6507beef24f76540c0c1143c5c
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b13812ddea615b6507beef24f76540c0c1143c5c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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 >>):

   arch/mips/pci/ops-loongson2.c: In function 'loongson_pcibios_config_access':
>> arch/mips/pci/ops-loongson2.c:39:6: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
      39 |  u32 dummy;
         |      ^~~~~
--
>> arch/mips/loongson2ef/common/mem.c:54:5: warning: no previous prototype for '__uncached_access' [-Wmissing-prototypes]
      54 | int __uncached_access(struct file *file, unsigned long addr)
         |     ^~~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/machtype.c:34:20: warning: no previous prototype for 'mach_prom_init_machtype' [-Wmissing-prototypes]
      34 | void __weak __init mach_prom_init_machtype(void)
         |                    ^~~~~~~~~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/lemote-2f/machtype.c:10:13: warning: no previous prototype for 'mach_prom_init_machtype' [-Wmissing-prototypes]
      10 | void __init mach_prom_init_machtype(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/cs5536/cs5536_ide.c:15:6: warning: no previous prototype for 'pci_ide_write_reg' [-Wmissing-prototypes]
      15 | void pci_ide_write_reg(int reg, u32 value)
         |      ^~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_ide.c:96:5: warning: no previous prototype for 'pci_ide_read_reg' [-Wmissing-prototypes]
      96 | u32 pci_ide_read_reg(int reg)
         |     ^~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/cs5536/cs5536_acc.c:15:6: warning: no previous prototype for 'pci_acc_write_reg' [-Wmissing-prototypes]
      15 | void pci_acc_write_reg(int reg, u32 value)
         |      ^~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_acc.c:62:5: warning: no previous prototype for 'pci_acc_read_reg' [-Wmissing-prototypes]
      62 | u32 pci_acc_read_reg(int reg)
         |     ^~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/cs5536/cs5536_ohci.c:15:6: warning: no previous prototype for 'pci_ohci_write_reg' [-Wmissing-prototypes]
      15 | void pci_ohci_write_reg(int reg, u32 value)
         |      ^~~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_ohci.c:70:5: warning: no previous prototype for 'pci_ohci_read_reg' [-Wmissing-prototypes]
      70 | u32 pci_ohci_read_reg(int reg)
         |     ^~~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:84:6: warning: no previous prototype for 'pci_isa_write_bar' [-Wmissing-prototypes]
      84 | void pci_isa_write_bar(int n, u32 value)
         |      ^~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:110:5: warning: no previous prototype for 'pci_isa_read_bar' [-Wmissing-prototypes]
     110 | u32 pci_isa_read_bar(int n)
         |     ^~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:134:6: warning: no previous prototype for 'pci_isa_write_reg' [-Wmissing-prototypes]
     134 | void pci_isa_write_reg(int reg, u32 value)
         |      ^~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:228:5: warning: no previous prototype for 'pci_isa_read_reg' [-Wmissing-prototypes]
     228 | u32 pci_isa_read_reg(int reg)
         |     ^~~~~~~~~~~~~~~~
--
>> arch/mips/loongson2ef/common/cs5536/cs5536_ehci.c:15:6: warning: no previous prototype for 'pci_ehci_write_reg' [-Wmissing-prototypes]
      15 | void pci_ehci_write_reg(int reg, u32 value)
         |      ^~~~~~~~~~~~~~~~~~
>> arch/mips/loongson2ef/common/cs5536/cs5536_ehci.c:75:5: warning: no previous prototype for 'pci_ehci_read_reg' [-Wmissing-prototypes]
      75 | u32 pci_ehci_read_reg(int reg)
         |     ^~~~~~~~~~~~~~~~~


vim +/dummy +39 arch/mips/pci/ops-loongson2.c

e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   30  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   31  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   32  static int loongson_pcibios_config_access(unsigned char access_type,
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   33  				      struct pci_bus *bus,
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   34  				      unsigned int devfn, int where,
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   35  				      u32 *data)
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   36  {
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   37  	u32 busnum = bus->number;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   38  	u32 addr, type;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  @39  	u32 dummy;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   40  	void *addrp;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   41  	int device = PCI_SLOT(devfn);
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   42  	int function = PCI_FUNC(devfn);
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   43  	int reg = where & ~3;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   44  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   45  	if (busnum == 0) {
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   46  		/* board-specific part,currently,only fuloong2f,yeeloong2f
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   47  		 * use CS5536, fuloong2e use via686b, gdium has no
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   48  		 * south bridge
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   49  		 */
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   50  #ifdef CONFIG_CS5536
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   51  		/* cs5536_pci_conf_read4/write4() will call _rdmsr/_wrmsr() to
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   52  		 * access the regsters PCI_MSR_ADDR, PCI_MSR_DATA_LO,
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   53  		 * PCI_MSR_DATA_HI, which is bigger than PCI_MSR_CTRL, so, it
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   54  		 * will not go this branch, but the others. so, no calling dead
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   55  		 * loop here.
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   56  		 */
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   57  		if ((PCI_IDSEL_CS5536 == device) && (reg < PCI_MSR_CTRL)) {
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   58  			switch (access_type) {
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   59  			case PCI_ACCESS_READ:
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   60  				*data = cs5536_pci_conf_read4(function, reg);
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   61  				break;
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   62  			case PCI_ACCESS_WRITE:
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   63  				cs5536_pci_conf_write4(function, reg, *data);
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   64  				break;
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   65  			}
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   66  			return 0;
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   67  		}
1032bce3ef81cb31 arch/mips/pci/ops-loongson2.c Wu Zhangjin 2009-11-10   68  #endif
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   69  		/* Type 0 configuration for onboard PCI bus */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   70  		if (device > MAX_DEV_NUM)
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   71  			return -1;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   72  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   73  		addr = (1 << (device + ID_SEL_BEGIN)) | (function << 8) | reg;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   74  		type = 0;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   75  	} else {
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   76  		/* Type 1 configuration for offboard PCI bus */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   77  		addr = (busnum << 16) | (device << 11) | (function << 8) | reg;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   78  		type = 0x10000;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   79  	}
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   80  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   81  	/* Clear aborts */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   82  	LOONGSON_PCICMD |= LOONGSON_PCICMD_MABORT_CLR | \
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   83  				LOONGSON_PCICMD_MTABORT_CLR;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   84  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   85  	LOONGSON_PCIMAP_CFG = (addr >> 16) | type;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   86  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   87  	/* Flush Bonito register block */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   88  	dummy = LOONGSON_PCIMAP_CFG;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   89  	mmiowb();
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   90  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   91  	addrp = CFG_SPACE_REG(addr & 0xffff);
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   92  	if (access_type == PCI_ACCESS_WRITE)
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   93  		writel(cpu_to_le32(*data), addrp);
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   94  	else
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   95  		*data = le32_to_cpu(readl(addrp));
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   96  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   97  	/* Detect Master/Target abort */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   98  	if (LOONGSON_PCICMD & (LOONGSON_PCICMD_MABORT_CLR |
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16   99  			     LOONGSON_PCICMD_MTABORT_CLR)) {
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  100  		/* Error occurred */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  101  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  102  		/* Clear bits */
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  103  		LOONGSON_PCICMD |= (LOONGSON_PCICMD_MABORT_CLR |
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  104  				  LOONGSON_PCICMD_MTABORT_CLR);
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  105  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  106  		return -1;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  107  	}
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  108  
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  109  	return 0;
e2fee5723bbda4a0 arch/mips/pci/ops-fuloong2e.c Wu Zhangjin 2009-10-16  110  

:::::: The code at line 39 was first introduced by commit
:::::: e2fee5723bbda4a05c86f16a9d0f889a2c4ecede MIPS: Bonito64: Make Loongson independent from Bonito64 code.

:::::: TO: Wu Zhangjin <wuzhangjin@...il.com>
:::::: CC: Ralf Baechle <ralf@...ux-mips.org>

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

Powered by blists - more mailing lists