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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202410211139.nbQGaA39-lkp@intel.com>
Date: Mon, 21 Oct 2024 11:59:37 +0800
From: kernel test robot <lkp@...el.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: drivers/ata/pata_gayle.c:53:27: sparse: sparse: incorrect type in
 argument 1 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   42f7652d3eb527d03665b09edac47f85fb600924
commit: c7db3832ff19a9a1116c1b3d435c9db165a2f2f8 m68k: io: Mark mmio read addresses as const
date:   1 year, 1 month ago
config: m68k-randconfig-r132-20241021 (https://download.01.org/0day-ci/archive/20241021/202410211139.nbQGaA39-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20241021/202410211139.nbQGaA39-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410211139.nbQGaA39-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/ata/pata_gayle.c:53:27: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ata/pata_gayle.c:53:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *port @@     got unsigned short [usertype] * @@
   drivers/ata/pata_gayle.c:53:27: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *port
   drivers/ata/pata_gayle.c:53:27: sparse:     got unsigned short [usertype] *
   drivers/ata/pata_gayle.c:55:28: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/ata/pata_gayle.c:55:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short volatile [noderef] [usertype] __iomem *port @@     got unsigned short [usertype] * @@
   drivers/ata/pata_gayle.c:55:28: sparse:     expected unsigned short volatile [noderef] [usertype] __iomem *port
   drivers/ata/pata_gayle.c:55:28: sparse:     got unsigned short [usertype] *
   drivers/ata/pata_gayle.c:65:35: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/ata/pata_gayle.c:65:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *port @@     got unsigned short [usertype] * @@
   drivers/ata/pata_gayle.c:65:35: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *port
   drivers/ata/pata_gayle.c:65:35: sparse:     got unsigned short [usertype] *
   drivers/ata/pata_gayle.c:69:36: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/ata/pata_gayle.c:69:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short volatile [noderef] [usertype] __iomem *port @@     got unsigned short [usertype] * @@
   drivers/ata/pata_gayle.c:69:36: sparse:     expected unsigned short volatile [noderef] [usertype] __iomem *port
   drivers/ata/pata_gayle.c:69:36: sparse:     got unsigned short [usertype] *
   drivers/ata/pata_gayle.c:181:29: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/ata/pata_gayle.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
   include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false

vim +53 drivers/ata/pata_gayle.c

9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  40  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  41  /* FIXME: is this needed? */
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  42  static unsigned int pata_gayle_data_xfer(struct ata_queued_cmd *qc,
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  43  					 unsigned char *buf,
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  44  					 unsigned int buflen, int rw)
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  45  {
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  46  	struct ata_device *dev = qc->dev;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  47  	struct ata_port *ap = dev->link->ap;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  48  	void __iomem *data_addr = ap->ioaddr.data_addr;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  49  	unsigned int words = buflen >> 1;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  50  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  51  	/* Transfer multiple of 2 bytes */
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  52  	if (rw == READ)
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16 @53  		raw_insw((u16 *)data_addr, (u16 *)buf, words);
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  54  	else
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  55  		raw_outsw((u16 *)data_addr, (u16 *)buf, words);
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  56  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  57  	/* Transfer trailing byte, if any. */
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  58  	if (unlikely(buflen & 0x01)) {
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  59  		unsigned char pad[2] = { };
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  60  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  61  		/* Point buf to the tail of buffer */
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  62  		buf += buflen - 1;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  63  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  64  		if (rw == READ) {
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  65  			raw_insw((u16 *)data_addr, (u16 *)pad, 1);
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  66  			*buf = pad[0];
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  67  		} else {
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  68  			pad[0] = *buf;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  69  			raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  70  		}
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  71  		words++;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  72  	}
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  73  
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  74  	return words << 1;
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  75  }
9ab27d1d35fda0 Bartlomiej Zolnierkiewicz 2018-03-16  76  

:::::: The code at line 53 was first introduced by commit
:::::: 9ab27d1d35fda0c5fce624083e92546a8545e7e5 ata: add Amiga Gayle PATA controller driver

:::::: TO: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
:::::: CC: Tejun Heo <tj@...nel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ