drivers/remoteproc/stm32_rproc.c:655:25: sparse: sparse: Using plain integer as NULL pointer

From: kernel test robot
Date: Sun Aug 30 2020 - 16:01:07 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1127b219ce9481c84edad9711626d856127d5e51
commit: 376ffdc044568fcd9982a89d57eed67874566f85 remoteproc: stm32: Properly set co-processor state when attaching
date: 6 weeks ago
config: arm-randconfig-s031-20200831 (attached as .config)
compiler: arm-linux-gnueabi-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 376ffdc044568fcd9982a89d57eed67874566f85
# 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=arm

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/remoteproc/stm32_rproc.c:118:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/stm32_rproc.c:118:12: sparse: expected void *va
drivers/remoteproc/stm32_rproc.c:118:12: sparse: got void [noderef] <asn:2> *
drivers/remoteproc/stm32_rproc.c:135:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] <asn:2> *iomem_cookie @@ got void *va @@
drivers/remoteproc/stm32_rproc.c:135:20: sparse: expected void volatile [noderef] <asn:2> *iomem_cookie
drivers/remoteproc/stm32_rproc.c:135:20: sparse: got void *va
>> drivers/remoteproc/stm32_rproc.c:655:25: sparse: sparse: Using plain integer as NULL pointer

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=376ffdc044568fcd9982a89d57eed67874566f85
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 376ffdc044568fcd9982a89d57eed67874566f85
vim +655 drivers/remoteproc/stm32_rproc.c

645
646 static int stm32_rproc_get_m4_status(struct stm32_rproc *ddata,
647 unsigned int *state)
648 {
649 /* See stm32_rproc_parse_dt() */
650 if (!ddata->m4_state.map) {
651 /*
652 * We couldn't get the coprocessor's state, assume
653 * it is not running.
654 */
> 655 state = M4_STATE_OFF;
656 return 0;
657 }
658
659 return regmap_read(ddata->m4_state.map, ddata->m4_state.reg, state);
660 }
661

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

Attachment: .config.gz
Description: application/gzip