From: kernel test robot <lkp@intel.com>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Palmer Dabbelt <palmer@rivosinc.com>
Subject: drivers/clocksource/timer-clint.c:82:24: sparse: sparse: cast removes address space '__iomem' of expression
Date: Sun, 5 Mar 2023 06:56:06 +0800 [thread overview]
Message-ID: <202303050655.acu5xXOh-lkp@intel.com> (raw)
Hi Aurelien,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c29214bc89169f735657f614bde7c0fad74bd1b5
commit: 6df2a016c0c8a3d0933ef33dd192ea6606b115e3 riscv: fix build with binutils 2.38
date: 1 year, 1 month ago
config: riscv-randconfig-s033-20230305 (https://download.01.org/0day-ci/archive/20230305/202303050655.acu5xXOh-lkp@intel.com/config)
compiler: riscv32-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=6df2a016c0c8a3d0933ef33dd192ea6606b115e3
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6df2a016c0c8a3d0933ef33dd192ea6606b115e3
# 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=riscv olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/clocksource/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303050655.acu5xXOh-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/clocksource/timer-clint.c:82:24: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/clocksource/timer-clint.c:82:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
drivers/clocksource/timer-clint.c:82:24: sparse: expected void const volatile [noderef] __iomem *addr
drivers/clocksource/timer-clint.c:82:24: sparse: got unsigned int [usertype] *
drivers/clocksource/timer-clint.c:80:22: sparse: sparse: cast removes address space '__iomem' of expression
drivers/clocksource/timer-clint.c:80:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
drivers/clocksource/timer-clint.c:80:22: sparse: expected void const volatile [noderef] __iomem *addr
drivers/clocksource/timer-clint.c:80:22: sparse: got unsigned int [usertype] *
drivers/clocksource/timer-clint.c:237:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void * @@ got struct clock_event_device [noderef] __percpu * @@
drivers/clocksource/timer-clint.c:237:36: sparse: expected void *
drivers/clocksource/timer-clint.c:237:36: sparse: got struct clock_event_device [noderef] __percpu *
vim +/__iomem +82 drivers/clocksource/timer-clint.c
2ac6795fcc085e Anup Patel 2020-08-17 68
2ac6795fcc085e Anup Patel 2020-08-17 69 #ifdef CONFIG_64BIT
2ac6795fcc085e Anup Patel 2020-08-17 70 static u64 notrace clint_get_cycles64(void)
2ac6795fcc085e Anup Patel 2020-08-17 71 {
2ac6795fcc085e Anup Patel 2020-08-17 72 return clint_get_cycles();
2ac6795fcc085e Anup Patel 2020-08-17 73 }
2ac6795fcc085e Anup Patel 2020-08-17 74 #else /* CONFIG_64BIT */
2ac6795fcc085e Anup Patel 2020-08-17 75 static u64 notrace clint_get_cycles64(void)
2ac6795fcc085e Anup Patel 2020-08-17 76 {
2ac6795fcc085e Anup Patel 2020-08-17 77 u32 hi, lo;
2ac6795fcc085e Anup Patel 2020-08-17 78
2ac6795fcc085e Anup Patel 2020-08-17 79 do {
2ac6795fcc085e Anup Patel 2020-08-17 80 hi = clint_get_cycles_hi();
2ac6795fcc085e Anup Patel 2020-08-17 81 lo = clint_get_cycles();
2ac6795fcc085e Anup Patel 2020-08-17 @82 } while (hi != clint_get_cycles_hi());
2ac6795fcc085e Anup Patel 2020-08-17 83
2ac6795fcc085e Anup Patel 2020-08-17 84 return ((u64)hi << 32) | lo;
2ac6795fcc085e Anup Patel 2020-08-17 85 }
2ac6795fcc085e Anup Patel 2020-08-17 86 #endif /* CONFIG_64BIT */
2ac6795fcc085e Anup Patel 2020-08-17 87
:::::: The code at line 82 was first introduced by commit
:::::: 2ac6795fcc085e8d03649f1bbd0d70aaff612cad clocksource/drivers: Add CLINT timer driver
:::::: TO: Anup Patel <anup.patel@wdc.com>
:::::: CC: Palmer Dabbelt <palmerdabbelt@google.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-03-04 22:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 22:56 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-12-15 21:50 drivers/clocksource/timer-clint.c:82:24: sparse: sparse: cast removes address space '__iomem' of expression kernel test robot
2022-08-01 16:26 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202303050655.acu5xXOh-lkp@intel.com \
--to=lkp@intel.com \
--cc=aurelien@aurel32.net \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@rivosinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox