drivers/watchdog/at91rm9200_wdt.c:219:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces))

From: kernel test robot
Date: Tue Apr 20 2021 - 17:54:24 EST


Hi Masahiro,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7af08140979a6e7e12b78c93b8625c8d25b084e2
commit: ea29b20a828511de3348334e529a3d046a180416 init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
date: 5 weeks ago
config: s390-randconfig-s032-20210420 (attached as .config)
compiler: s390-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.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ea29b20a828511de3348334e529a3d046a180416
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ea29b20a828511de3348334e529a3d046a180416
# 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__' W=1 ARCH=s390

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/watchdog/at91rm9200_wdt.c:219:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected long ( *write )( ... ) @@ got long ( * )( ... ) @@
drivers/watchdog/at91rm9200_wdt.c:219:27: sparse: expected long ( *write )( ... )
drivers/watchdog/at91rm9200_wdt.c:219:27: sparse: got long ( * )( ... )

vim +219 drivers/watchdog/at91rm9200_wdt.c

853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 211
62322d2554d2f9 drivers/char/watchdog/at91_wdt.c Arjan van de Ven 2006-07-03 212 static const struct file_operations at91wdt_fops = {
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 213 .owner = THIS_MODULE,
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 214 .llseek = no_llseek,
2760600da2a13d drivers/watchdog/at91rm9200_wdt.c Alan Cox 2008-05-19 215 .unlocked_ioctl = at91_wdt_ioctl,
b6dfb2477fb0bf drivers/watchdog/at91rm9200_wdt.c Arnd Bergmann 2019-06-03 216 .compat_ioctl = compat_ptr_ioctl,
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 217 .open = at91_wdt_open,
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 218 .release = at91_wdt_close,
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 @219 .write = at91_wdt_write,
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 220 };
853807fb500a94 drivers/char/watchdog/at91_wdt.c Andrew Victor 2006-03-14 221

:::::: The code at line 219 was first introduced by commit
:::::: 853807fb500a9442d88646b7be92bfa51334f8e8 [WATCHDOG] at91_wdt.c - Atmel AT91RM9200 watchdog driver

:::::: TO: Andrew Victor <andrew@xxxxxxxxxxxxx>
:::::: CC: Wim Van Sebroeck <wim@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip