[linux-next:master 3267/4901] arch/powerpc/platforms/powermac/nvram.c:304:24: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   395a61741f7ea29e1f4a0d6e160197fe8e377572
commit: 4cfbda15d6578759c0157b18698e0c10ba598856 [3267/4901] fortify: Add Clang support
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20220211/202202110552.DxobMxL7-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 11.2.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-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4cfbda15d6578759c0157b18698e0c10ba598856
        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 4cfbda15d6578759c0157b18698e0c10ba598856
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/platforms/powermac/

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


sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/platforms/powermac/nvram.c:304:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got unsigned char [noderef] [usertype] __iomem *base @@
   arch/powerpc/platforms/powermac/nvram.c:304:24: sparse:     expected void const *const p
   arch/powerpc/platforms/powermac/nvram.c:304:24: sparse:     got unsigned char [noderef] [usertype] __iomem *base
   arch/powerpc/platforms/powermac/nvram.c:338:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got unsigned char [noderef] [usertype] __iomem *base @@
   arch/powerpc/platforms/powermac/nvram.c:338:20: sparse:     expected void const *const p
   arch/powerpc/platforms/powermac/nvram.c:338:20: sparse:     got unsigned char [noderef] [usertype] __iomem *base
   arch/powerpc/platforms/powermac/nvram.c:384:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got unsigned char [noderef] [usertype] __iomem *base @@
   arch/powerpc/platforms/powermac/nvram.c:384:24: sparse:     expected void const *const p
   arch/powerpc/platforms/powermac/nvram.c:384:24: sparse:     got unsigned char [noderef] [usertype] __iomem *base
   arch/powerpc/platforms/powermac/nvram.c:429:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got unsigned char [noderef] [usertype] __iomem *base @@
   arch/powerpc/platforms/powermac/nvram.c:429:20: sparse:     expected void const *const p
   arch/powerpc/platforms/powermac/nvram.c:429:20: sparse:     got unsigned char [noderef] [usertype] __iomem *base
   arch/powerpc/platforms/powermac/nvram.c:480:35: sparse: sparse: cast removes address space '__iomem' of expression
   arch/powerpc/platforms/powermac/nvram.c:526:35: sparse: sparse: cast removes address space '__iomem' of expression
   arch/powerpc/platforms/powermac/nvram.c:527:35: sparse: sparse: cast removes address space '__iomem' of expression
   arch/powerpc/platforms/powermac/nvram.c:534:44: sparse: sparse: dereference of noderef expression

vim +304 arch/powerpc/platforms/powermac/nvram.c

14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  279  
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  280  static int sm_erase_bank(int bank)
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  281  {
2d4b971287cbce arch/powerpc/platforms/powermac/nvram.c      Akinobu Mita     2012-01-27  282  	int stat;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  283  	unsigned long timeout;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  284  
af308377e204e2 arch/powerpc/platforms/powermac/nvram.c      Stephen Rothwell 2006-03-23  285  	u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  286  
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  287         	DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  288  
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  289  	out_8(base, SM_FLASH_CMD_ERASE_SETUP);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  290  	out_8(base, SM_FLASH_CMD_ERASE_CONFIRM);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  291  	timeout = 0;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  292  	do {
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  293  		if (++timeout > 1000000) {
35499c0195e46f arch/powerpc/platforms/powermac/nvram.c      Paul Mackerras   2005-10-22  294  			printk(KERN_ERR "nvram: Sharp/Micron flash erase timeout !\n");
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  295  			break;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  296  		}
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  297  		out_8(base, SM_FLASH_CMD_READ_STATUS);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  298  		stat = in_8(base);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  299  	} while (!(stat & SM_FLASH_STATUS_DONE));
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  300  
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  301  	out_8(base, SM_FLASH_CMD_CLEAR_STATUS);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  302  	out_8(base, SM_FLASH_CMD_RESET);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  303  
2d4b971287cbce arch/powerpc/platforms/powermac/nvram.c      Akinobu Mita     2012-01-27 @304  	if (memchr_inv(base, 0xff, NVRAM_SIZE)) {
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  305  		printk(KERN_ERR "nvram: Sharp/Micron flash erase failed !\n");
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  306  		return -ENXIO;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  307  	}
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  308  	return 0;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  309  }
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_nvram.c Paul Mackerras   2005-09-26  310  

:::::: The code at line 304 was first introduced by commit
:::::: 2d4b971287cbce16585acda4b76308faa8da0950 powerpc/pmac: Use string library in nvram code

:::::: TO: Akinobu Mita <akinobu.mita@xxxxxxxxx>
:::::: CC: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux