drivers/clocksource/timer-nps.c:84:52: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Sun Jul 24 2022 - 12:21:28 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 515f71412bb73ebd7f41f90e1684fc80b8730789
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date: 1 year, 11 months ago
config: openrisc-randconfig-s051-20220724 (https://download.01.org/0day-ci/archive/20220725/202207250025.oCc99b1T-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8f28ca6bd8211214faf717677bbffe375c2a6072
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/clk/imx/ drivers/clocksource/ drivers/media/ drivers/mfd/ drivers/phy/mediatek/ drivers/tty/serial/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

sparse warnings: (new ones prefixed by >>)
>> drivers/clocksource/timer-nps.c:84:52: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got void * @@
drivers/clocksource/timer-nps.c:84:52: sparse: expected void const [noderef] __iomem *
drivers/clocksource/timer-nps.c:84:52: sparse: got void *
drivers/clocksource/timer-nps.c:103:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem * @@ got void ** @@
drivers/clocksource/timer-nps.c:103:37: sparse: expected void [noderef] __iomem *
drivers/clocksource/timer-nps.c:103:37: sparse: got void **
--
>> drivers/tty/serial/ucc_uart.c:264:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:264:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:264:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:268:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:268:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:268:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:286:6: sparse: sparse: symbol 'qe_uart_set_mctrl' was not declared. Should it be static?
drivers/tty/serial/ucc_uart.c:347:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:347:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:347:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:348:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:348:17: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:348:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:348:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:348:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:348:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:350:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:350:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:350:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:369:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:369:18: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:369:18: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:382:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:382:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:382:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:383:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:383:17: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:383:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:383:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:383:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:383:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:386:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:386:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:386:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:474:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:474:26: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:474:26: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:481:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:481:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:481:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:512:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:512:17: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:512:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:512:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:512:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:512:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:515:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:515:21: sparse: expected void const [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:515:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:604:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:604:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:604:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:605:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:605:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:605:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:606:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:606:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:606:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:612:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:612:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:612:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:613:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:613:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:613:9: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:614:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:614:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:614:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:625:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:625:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:625:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:626:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:626:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:626:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:627:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:627:17: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:627:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:637:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:637:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:637:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:638:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:638:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:638:9: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:639:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:639:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:639:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:653:46: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ucc_uart_pram *uccup @@ got struct ucc_uart_pram [noderef] __iomem *uccup @@
drivers/tty/serial/ucc_uart.c:653:46: sparse: expected struct ucc_uart_pram *uccup
drivers/tty/serial/ucc_uart.c:653:46: sparse: got struct ucc_uart_pram [noderef] __iomem *uccup
drivers/tty/serial/ucc_uart.c:661:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:661:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:661:9: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:662:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:662:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:662:9: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:663:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:663:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:663:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:664:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:664:9: sparse: expected void [noderef] __iomem *
drivers/tty/serial/ucc_uart.c:664:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:665:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got restricted __be16 * @@

vim +84 drivers/clocksource/timer-nps.c

a53224577e317d Noam Camus 2015-10-17 79
a5a1d1c2914b53 Thomas Gleixner 2016-12-21 80 static u64 nps_clksrc_read(struct clocksource *clksrc)
a53224577e317d Noam Camus 2015-10-17 81 {
a53224577e317d Noam Camus 2015-10-17 82 int cluster = raw_smp_processor_id() >> NPS_CLUSTER_OFFSET;
a53224577e317d Noam Camus 2015-10-17 83
a5a1d1c2914b53 Thomas Gleixner 2016-12-21 @84 return (u64)ioread32be(nps_msu_reg_low_addr[cluster]);
a53224577e317d Noam Camus 2015-10-17 85 }
a53224577e317d Noam Camus 2015-10-17 86

:::::: The code at line 84 was first introduced by commit
:::::: a5a1d1c2914b5316924c7893eb683a5420ebd3be clocksource: Use a plain u64 instead of cycle_t

:::::: TO: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://01.org/lkp