linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 196/4016] arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2021-05-20 11:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-20 11:24 UTC (permalink / raw)
  To: Yejune Deng; +Cc: kbuild-all, Linux Memory Management List, Rich Felker

[-- Attachment #1: Type: text/plain, Size: 3294 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7a42b92b6d30c3f09629c7d5ada9e3de2aba01af
commit: 258cf5f8aef48f76e1933fc9524a476d21e21e68 [196/4016] sh: kdump: add some attribute to function
config: sh-allyesconfig (attached as .config)
compiler: sh4-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/next/linux-next.git/commit/?id=258cf5f8aef48f76e1933fc9524a476d21e21e68
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 258cf5f8aef48f76e1933fc9524a476d21e21e68
        # 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=sh 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void [noderef] __iomem * @@
   arch/sh/kernel/crash_dump.c:37:61: sparse:     expected void const *from
   arch/sh/kernel/crash_dump.c:37:61: sparse:     got void [noderef] __iomem *
>> arch/sh/kernel/crash_dump.c:42:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *__from @@     got void [noderef] __iomem * @@
   arch/sh/kernel/crash_dump.c:42:28: sparse:     expected void const *__from
   arch/sh/kernel/crash_dump.c:42:28: sparse:     got void [noderef] __iomem *

vim +37 arch/sh/kernel/crash_dump.c

    12	
    13	/**
    14	 * copy_oldmem_page - copy one page from "oldmem"
    15	 * @pfn: page frame number to be copied
    16	 * @buf: target memory address for the copy; this can be in kernel address
    17	 *	space or user address space (see @userbuf)
    18	 * @csize: number of bytes to copy
    19	 * @offset: offset in bytes into the page (based on pfn) to begin the copy
    20	 * @userbuf: if set, @buf is in user address space, use copy_to_user(),
    21	 *	otherwise @buf is in kernel address space, use memcpy().
    22	 *
    23	 * Copy a page from "oldmem". For this page, there is no pte mapped
    24	 * in the current kernel. We stitch up a pte, similar to kmap_atomic.
    25	 */
    26	ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
    27	                               size_t csize, unsigned long offset, int userbuf)
    28	{
    29		void  __iomem *vaddr;
    30	
    31		if (!csize)
    32			return 0;
    33	
    34		vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
    35	
    36		if (userbuf) {
  > 37			if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
    38				iounmap(vaddr);
    39				return -EFAULT;
    40			}
    41		} else
  > 42		memcpy(buf, (vaddr + offset), csize);

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54255 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-20 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 11:24 [linux-next:master 196/4016] arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox