mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/edac/pnd2_edac.c:295:22: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sun, 9 Aug 2020 03:09:44 +0800	[thread overview]
Message-ID: <202008090342.8VPURFq3%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   11030fe96b57ad843518b0e9430f3cd4b3610ce2
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   7 weeks ago
config: x86_64-randconfig-s031-20200809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-118-ge1578773-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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 >>)

>> drivers/edac/pnd2_edac.c:295:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected char *base @@     got void [noderef] __iomem * @@
   drivers/edac/pnd2_edac.c:295:22: sparse:     expected char *base
>> drivers/edac/pnd2_edac.c:295:22: sparse:     got void [noderef] __iomem *
>> drivers/edac/pnd2_edac.c:303:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got char *base @@
>> drivers/edac/pnd2_edac.c:303:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/edac/pnd2_edac.c:303:25: sparse:     got char *base
--
>> drivers/edac/i10nm_base.c:149:19: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/edac/i10nm_base.c:170:31: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/edac/i10nm_base.c:171:37: sparse: sparse: cast removes address space '__iomem' of expression

vim +295 drivers/edac/pnd2_edac.c

5c71ad17f97e84 Tony Luck       2017-03-09  262  
29a3388bfcce7a Stephen Douthit 2019-08-09  263  #define DNV_MCHBAR_SIZE  0x8000
29a3388bfcce7a Stephen Douthit 2019-08-09  264  #define DNV_SB_PORT_SIZE 0x10000
5c71ad17f97e84 Tony Luck       2017-03-09  265  static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *name)
5c71ad17f97e84 Tony Luck       2017-03-09  266  {
5c71ad17f97e84 Tony Luck       2017-03-09  267  	struct pci_dev *pdev;
5c71ad17f97e84 Tony Luck       2017-03-09  268  	char *base;
5c71ad17f97e84 Tony Luck       2017-03-09  269  	u64 addr;
29a3388bfcce7a Stephen Douthit 2019-08-09  270  	unsigned long size;
5c71ad17f97e84 Tony Luck       2017-03-09  271  
5c71ad17f97e84 Tony Luck       2017-03-09  272  	if (op == 4) {
5c71ad17f97e84 Tony Luck       2017-03-09  273  		pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x1980, NULL);
5c71ad17f97e84 Tony Luck       2017-03-09  274  		if (!pdev)
5c71ad17f97e84 Tony Luck       2017-03-09  275  			return -ENODEV;
5c71ad17f97e84 Tony Luck       2017-03-09  276  
5c71ad17f97e84 Tony Luck       2017-03-09  277  		pci_read_config_dword(pdev, off, data);
5c71ad17f97e84 Tony Luck       2017-03-09  278  		pci_dev_put(pdev);
5c71ad17f97e84 Tony Luck       2017-03-09  279  	} else {
5c71ad17f97e84 Tony Luck       2017-03-09  280  		/* MMIO via memory controller hub base address */
5c71ad17f97e84 Tony Luck       2017-03-09  281  		if (op == 0 && port == 0x4c) {
5c71ad17f97e84 Tony Luck       2017-03-09  282  			addr = get_mem_ctrl_hub_base_addr();
5c71ad17f97e84 Tony Luck       2017-03-09  283  			if (!addr)
5c71ad17f97e84 Tony Luck       2017-03-09  284  				return -ENODEV;
29a3388bfcce7a Stephen Douthit 2019-08-09  285  			size = DNV_MCHBAR_SIZE;
5c71ad17f97e84 Tony Luck       2017-03-09  286  		} else {
5c71ad17f97e84 Tony Luck       2017-03-09  287  			/* MMIO via sideband register base address */
5c71ad17f97e84 Tony Luck       2017-03-09  288  			addr = get_sideband_reg_base_addr();
5c71ad17f97e84 Tony Luck       2017-03-09  289  			if (!addr)
5c71ad17f97e84 Tony Luck       2017-03-09  290  				return -ENODEV;
5c71ad17f97e84 Tony Luck       2017-03-09  291  			addr += (port << 16);
29a3388bfcce7a Stephen Douthit 2019-08-09  292  			size = DNV_SB_PORT_SIZE;
5c71ad17f97e84 Tony Luck       2017-03-09  293  		}
5c71ad17f97e84 Tony Luck       2017-03-09  294  
29a3388bfcce7a Stephen Douthit 2019-08-09 @295  		base = ioremap((resource_size_t)addr, size);
5c71ad17f97e84 Tony Luck       2017-03-09  296  		if (!base)
5c71ad17f97e84 Tony Luck       2017-03-09  297  			return -ENODEV;
5c71ad17f97e84 Tony Luck       2017-03-09  298  
5c71ad17f97e84 Tony Luck       2017-03-09  299  		if (sz == 8)
5c71ad17f97e84 Tony Luck       2017-03-09  300  			*(u32 *)(data + 4) = *(u32 *)(base + off + 4);
5c71ad17f97e84 Tony Luck       2017-03-09  301  		*(u32 *)data = *(u32 *)(base + off);
5c71ad17f97e84 Tony Luck       2017-03-09  302  
5c71ad17f97e84 Tony Luck       2017-03-09 @303  		iounmap(base);
5c71ad17f97e84 Tony Luck       2017-03-09  304  	}
5c71ad17f97e84 Tony Luck       2017-03-09  305  
5c71ad17f97e84 Tony Luck       2017-03-09  306  	edac_dbg(2, "Read %s=%.8x_%.8x\n", name,
5c71ad17f97e84 Tony Luck       2017-03-09  307  			(sz == 8) ? *(u32 *)(data + 4) : 0, *(u32 *)data);
5c71ad17f97e84 Tony Luck       2017-03-09  308  
5c71ad17f97e84 Tony Luck       2017-03-09  309  	return 0;
5c71ad17f97e84 Tony Luck       2017-03-09  310  }
5c71ad17f97e84 Tony Luck       2017-03-09  311  

:::::: The code at line 295 was first introduced by commit
:::::: 29a3388bfcce7a6d087051376ea02bf8326a957b EDAC, pnd2: Fix ioremap() size in dnv_rd_reg()

:::::: TO: Stephen Douthit <stephend@silicom-usa.com>
:::::: CC: Tony Luck <tony.luck@intel.com>

---
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: 33843 bytes --]

                 reply	other threads:[~2020-08-08 19:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202008090342.8VPURFq3%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.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

all inboxes | Powered by JetHome®