drivers/ata/pata_cmd64x.c:283:22: sparse: sparse: cast removes address space '__iomem' of expression

From: kernel test robot
Date: Mon Aug 24 2020 - 05:04:23 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d012a7190fc1fd72ed48911e77ca97ba4521bccd
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 10 weeks ago
config: riscv-randconfig-s032-20200824 (attached as .config)
compiler: riscv64-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-191-g10164920-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 <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/ata/pata_cmd64x.c:283:22: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_cmd64x.c:283:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/ata/pata_cmd64x.c:283:22: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_cmd64x.c:283:22: sparse: got void *
drivers/ata/pata_cmd64x.c:305:20: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_cmd64x.c:305:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_cmd64x.c:305:20: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_cmd64x.c:305:20: sparse: got void *
drivers/ata/pata_cmd64x.c:307:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_cmd64x.c:307:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/ata/pata_cmd64x.c:307:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_cmd64x.c:307:9: sparse: got void *
--
>> drivers/ata/pata_cypress.c:106:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_cypress.c:106:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/ata/pata_cypress.c:106:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_cypress.c:106:9: sparse: got void *
drivers/ata/pata_cypress.c:107:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_cypress.c:107:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_cypress.c:107:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_cypress.c:107:9: sparse: got void *
drivers/ata/pata_cypress.c:110:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_cypress.c:110:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_cypress.c:110:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_cypress.c:110:9: sparse: got void *
drivers/ata/pata_cypress.c:111:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_cypress.c:111:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_cypress.c:111:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_cypress.c:111:9: sparse: got void *
--
>> drivers/ata/pata_optidma.c:379:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_optidma.c:379:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/ata/pata_optidma.c:379:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/ata/pata_optidma.c:379:9: sparse: got void *
drivers/ata/pata_optidma.c:381:14: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_optidma.c:381:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/ata/pata_optidma.c:381:14: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_optidma.c:381:14: sparse: got void *
drivers/ata/pata_optidma.c:423:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_optidma.c:423:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_optidma.c:423:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_optidma.c:423:9: sparse: got void *
drivers/ata/pata_optidma.c:424:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_optidma.c:424:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_optidma.c:424:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_optidma.c:424:9: sparse: got void *
drivers/ata/pata_optidma.c:425:21: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ata/pata_optidma.c:425:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/ata/pata_optidma.c:425:21: sparse: expected void const volatile [noderef] __iomem *addr
drivers/ata/pata_optidma.c:425:21: sparse: got void *
--
>> drivers/media/radio/radio-maxiradio.c:94:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/media/radio/radio-maxiradio.c:94:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/media/radio/radio-maxiradio.c:94:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/media/radio/radio-maxiradio.c:94:9: sparse: got void *
drivers/media/radio/radio-maxiradio.c:102:19: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/media/radio/radio-maxiradio.c:102:19: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/media/radio/radio-maxiradio.c:102:19: sparse: expected void const volatile [noderef] __iomem *addr
drivers/media/radio/radio-maxiradio.c:102:19: sparse: got void *
drivers/media/radio/radio-maxiradio.c:184:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/media/radio/radio-maxiradio.c:184:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/media/radio/radio-maxiradio.c:184:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/media/radio/radio-maxiradio.c:184:9: sparse: got void *
--
>> drivers/video/fbdev/nvidia/nvidia.c:1411:20: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected void [noderef] __iomem *addr @@ got unsigned int volatile [noderef] [usertype] __iomem *REGS @@
>> drivers/video/fbdev/nvidia/nvidia.c:1411:20: sparse: expected void [noderef] __iomem *addr
drivers/video/fbdev/nvidia/nvidia.c:1411:20: sparse: got unsigned int volatile [noderef] [usertype] __iomem *REGS
drivers/video/fbdev/nvidia/nvidia.c:1436:20: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected void [noderef] __iomem *addr @@ got unsigned int volatile [noderef] [usertype] __iomem *REGS @@
drivers/video/fbdev/nvidia/nvidia.c:1436:20: sparse: expected void [noderef] __iomem *addr
drivers/video/fbdev/nvidia/nvidia.c:1436:20: sparse: got unsigned int volatile [noderef] [usertype] __iomem *REGS

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=670d0a4b10704667765f7d18f7592993d02783aa
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
vim +/__iomem +283 drivers/ata/pata_cmd64x.c

8a686bc984454c Sergei Shtylyov 2012-03-11 270
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 271 /**
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 272 * cmd648_sff_irq_check - check IDE interrupt
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 273 * @ap: ATA interface
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 274 *
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 275 * Check IDE interrupt in MRDMODE register.
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 276 */
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 277
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 278 static bool cmd648_sff_irq_check(struct ata_port *ap)
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 279 {
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 280 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 281 unsigned long base = pci_resource_start(pdev, 4);
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 282 int irq_mask = ap->port_no ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0;
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 @283 u8 mrdmode = inb(base + 1);
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 284
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 285 return mrdmode & irq_mask;
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 286 }
b8cec3c253a2a0 Sergei Shtylyov 2012-03-11 287
8a686bc984454c Sergei Shtylyov 2012-03-11 288 /**
419fd2461354f7 Sergei Shtylyov 2012-03-11 289 * cmd648_sff_irq_clear - clear IDE interrupt
419fd2461354f7 Sergei Shtylyov 2012-03-11 290 * @ap: ATA interface
669a5db411d85a Jeff Garzik 2006-08-29 291 *
419fd2461354f7 Sergei Shtylyov 2012-03-11 292 * Clear IDE interrupt in MRDMODE and DMA status registers.
669a5db411d85a Jeff Garzik 2006-08-29 293 */
669a5db411d85a Jeff Garzik 2006-08-29 294
419fd2461354f7 Sergei Shtylyov 2012-03-11 295 static void cmd648_sff_irq_clear(struct ata_port *ap)
669a5db411d85a Jeff Garzik 2006-08-29 296 {
669a5db411d85a Jeff Garzik 2006-08-29 297 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
8a686bc984454c Sergei Shtylyov 2012-03-11 298 unsigned long base = pci_resource_start(pdev, 4);
8a686bc984454c Sergei Shtylyov 2012-03-11 299 int irq_mask = ap->port_no ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0;
8a686bc984454c Sergei Shtylyov 2012-03-11 300 u8 mrdmode;
669a5db411d85a Jeff Garzik 2006-08-29 301
419fd2461354f7 Sergei Shtylyov 2012-03-11 302 ata_bmdma_irq_clear(ap);
669a5db411d85a Jeff Garzik 2006-08-29 303
8a686bc984454c Sergei Shtylyov 2012-03-11 304 /* Clear this port's interrupt bit (leaving the other port alone) */
8a686bc984454c Sergei Shtylyov 2012-03-11 305 mrdmode = inb(base + 1);
8a686bc984454c Sergei Shtylyov 2012-03-11 306 mrdmode &= ~(MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1);
8a686bc984454c Sergei Shtylyov 2012-03-11 @307 outb(mrdmode | irq_mask, base + 1);
669a5db411d85a Jeff Garzik 2006-08-29 308 }
669a5db411d85a Jeff Garzik 2006-08-29 309

:::::: The code at line 283 was first introduced by commit
:::::: b8cec3c253a2a001e463c43260fb75fb3223a04d pata_cmd64x: implement sff_irq_check() method

:::::: TO: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
:::::: CC: Jeff Garzik <jgarzik@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip