tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7 commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces date: 3 weeks ago config: riscv-randconfig-s031-20200709 (attached as .config) compiler: riscv32-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.2-37-gc9676a3b-dirty git checkout 670d0a4b10704667765f7d18f7592993d02783aa # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/watchdog/wdt_pci.c:103:9: sparse: sparse: cast removes address space '__iomem' of expression >> drivers/watchdog/wdt_pci.c:103:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ >> drivers/watchdog/wdt_pci.c:103:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:103:9: sparse: got void * drivers/watchdog/wdt_pci.c:109:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:109:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:109:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:109:9: sparse: got void * drivers/watchdog/wdt_pci.c:111:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:111:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:111:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:111:9: sparse: got void * drivers/watchdog/wdt_pci.c:131:9: sparse: sparse: cast removes address space '__iomem' of expression >> drivers/watchdog/wdt_pci.c:131:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ >> drivers/watchdog/wdt_pci.c:131:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:131:9: sparse: got void * drivers/watchdog/wdt_pci.c:135:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:135:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:135:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:135:9: sparse: got void * drivers/watchdog/wdt_pci.c:137:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:137:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:137:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:137:9: sparse: got void * drivers/watchdog/wdt_pci.c:139:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:139:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:139:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:139:9: sparse: got void * drivers/watchdog/wdt_pci.c:141:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:141:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:141:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:141:9: sparse: got void * drivers/watchdog/wdt_pci.c:143:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:143:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:143:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:143:9: sparse: got void * drivers/watchdog/wdt_pci.c:145:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:145:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:145:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:145:9: sparse: got void * drivers/watchdog/wdt_pci.c:147:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:147:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:147:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:147:9: sparse: got void * drivers/watchdog/wdt_pci.c:158:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:158:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:158:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:158:9: sparse: got void * drivers/watchdog/wdt_pci.c:177:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:177:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:177:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:177:9: sparse: got void * drivers/watchdog/wdt_pci.c:197:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:197:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:197:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:197:9: sparse: got void * drivers/watchdog/wdt_pci.c:202:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:202:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:202:9: sparse: expected void volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:202:9: sparse: got void * drivers/watchdog/wdt_pci.c:244:22: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:244:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:244:22: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:244:22: sparse: got void * drivers/watchdog/wdt_pci.c:279:13: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:279:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:279:13: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:279:13: sparse: got void * drivers/watchdog/wdt_pci.c:306:18: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:306:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:306:18: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:306:18: sparse: got void * drivers/watchdog/wdt_pci.c:313:25: sparse: sparse: cast removes address space '__iomem' of expression drivers/watchdog/wdt_pci.c:313:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/watchdog/wdt_pci.c:313:25: sparse: expected void const volatile [noderef] __iomem *addr drivers/watchdog/wdt_pci.c:313:25: sparse: got void * vim +/__iomem +103 drivers/watchdog/wdt_pci.c ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 69 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 70 static int heartbeat = WD_TIMO; ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 71 static int wd_heartbeat; ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 72 module_param(heartbeat, int, 0); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 73 MODULE_PARM_DESC(heartbeat, 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 74 "Watchdog heartbeat in seconds. (0> 8, WDT_COUNT0 + ctr); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 112 udelay(8); ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 113 } ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 114 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 115 /** ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 116 * wdtpci_start: ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 117 * ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 118 * Start the watchdog driver. ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 119 */ ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 120 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 121 static int wdtpci_start(void) ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 122 { ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 123 unsigned long flags; ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 124 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 125 spin_lock_irqsave(&wdtpci_lock, flags); ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 126 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 127 /* ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 128 * "pet" the watchdog, as Access says. ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 129 * This resets the clock outputs. ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 130 */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 @131 inb(WDT_DC); /* Disable watchdog */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 132 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 133 wdtpci_ctr_mode(2, 0); /* Program CTR2 for Mode 0: 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 134 Pulse on Terminal Count */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 135 outb(0, WDT_DC); /* Enable watchdog */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 136 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 137 inb(WDT_DC); /* Disable watchdog */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 138 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 139 outb(0, WDT_CLOCK); /* 2.0833MHz clock */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 140 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 141 inb(WDT_BUZZER); /* disable */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 142 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 143 inb(WDT_OPTONOTRST); /* disable */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 144 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 145 inb(WDT_OPTORST); /* disable */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 146 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 147 inb(WDT_PROGOUT); /* disable */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 148 udelay(8); 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 149 wdtpci_ctr_mode(0, 3); /* Program CTR0 for Mode 3: 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 150 Square Wave Generator */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 151 wdtpci_ctr_mode(1, 2); /* Program CTR1 for Mode 2: 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 152 Rate Generator */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 153 wdtpci_ctr_mode(2, 1); /* Program CTR2 for Mode 1: 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 154 Retriggerable One-Shot */ ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 155 wdtpci_ctr_load(0, 20833); /* count at 100Hz */ ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 156 wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */ ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 157 /* DO NOT LOAD CTR2 on PCI card! -- JPN */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 158 outb(0, WDT_DC); /* Enable watchdog */ 9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 159 udelay(8); ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 160 ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 161 spin_unlock_irqrestore(&wdtpci_lock, flags); ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 162 return 0; ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 163 } ^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 164 :::::: The code at line 103 was first introduced by commit :::::: 9f2d1f0da766f84fdb96c9bd79ed0f97036635cb wdt: Cleanup and sort out locking and inb_p :::::: TO: Alan Cox :::::: CC: Linus Torvalds --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org