All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 9509/9522] drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Sun, 22 Aug 2021 00:41:20 +0800	[thread overview]
Message-ID: <202108220011.GPvXGLuO-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   86ed57fd8c93fdfaabb4f58e78455180fa7d8a84
commit: a389ba5e5df26c9b904434677fd00cde641e4745 [9509/9522] slab: clean up function declarations
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a389ba5e5df26c9b904434677fd00cde641e4745
        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 a389ba5e5df26c9b904434677fd00cde641e4745
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc 

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/char/tpm/tpm_ibmvtpm.c:125:30: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *p @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse:     expected void *p
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:229:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse:     expected void const *objp
   drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *rtce_buf @@     got void * @@
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse:     expected void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse:     got void *
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *ptr @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse:     expected void *ptr
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse:     expected void const *objp
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse:     got void [noderef] __iomem *rtce_buf

vim +366 drivers/char/tpm/tpm_ibmvtpm.c

132f76294744244 Ashley Lai             2012-08-22  336  
132f76294744244 Ashley Lai             2012-08-22  337  /**
132f76294744244 Ashley Lai             2012-08-22  338   * tpm_ibmvtpm_remove - ibm vtpm remove entry point
132f76294744244 Ashley Lai             2012-08-22  339   * @vdev:	vio device struct
132f76294744244 Ashley Lai             2012-08-22  340   *
93c12f293f87982 Winkler, Tomas         2016-11-23  341   * Return: Always 0.
132f76294744244 Ashley Lai             2012-08-22  342   */
386a966f5ce71a0 Uwe Kleine-König       2021-02-25  343  static void tpm_ibmvtpm_remove(struct vio_dev *vdev)
132f76294744244 Ashley Lai             2012-08-22  344  {
9e0d39d8a6a0a88 Christophe Ricard      2016-03-31  345  	struct tpm_chip *chip = dev_get_drvdata(&vdev->dev);
9e0d39d8a6a0a88 Christophe Ricard      2016-03-31  346  	struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
132f76294744244 Ashley Lai             2012-08-22  347  	int rc = 0;
132f76294744244 Ashley Lai             2012-08-22  348  
afb5abc262e9620 Jarkko Sakkinen        2014-12-12  349  	tpm_chip_unregister(chip);
afb5abc262e9620 Jarkko Sakkinen        2014-12-12  350  
132f76294744244 Ashley Lai             2012-08-22  351  	free_irq(vdev->irq, ibmvtpm);
132f76294744244 Ashley Lai             2012-08-22  352  
132f76294744244 Ashley Lai             2012-08-22  353  	do {
132f76294744244 Ashley Lai             2012-08-22  354  		if (rc)
132f76294744244 Ashley Lai             2012-08-22  355  			msleep(100);
132f76294744244 Ashley Lai             2012-08-22  356  		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
132f76294744244 Ashley Lai             2012-08-22  357  	} while (rc == H_BUSY || H_IS_LONG_BUSY(rc));
132f76294744244 Ashley Lai             2012-08-22  358  
132f76294744244 Ashley Lai             2012-08-22  359  	dma_unmap_single(ibmvtpm->dev, ibmvtpm->crq_dma_handle,
132f76294744244 Ashley Lai             2012-08-22  360  			 CRQ_RES_BUF_SIZE, DMA_BIDIRECTIONAL);
132f76294744244 Ashley Lai             2012-08-22  361  	free_page((unsigned long)ibmvtpm->crq_queue.crq_addr);
132f76294744244 Ashley Lai             2012-08-22  362  
132f76294744244 Ashley Lai             2012-08-22  363  	if (ibmvtpm->rtce_buf) {
132f76294744244 Ashley Lai             2012-08-22  364  		dma_unmap_single(ibmvtpm->dev, ibmvtpm->rtce_dma_handle,
132f76294744244 Ashley Lai             2012-08-22  365  				 ibmvtpm->rtce_size, DMA_BIDIRECTIONAL);
132f76294744244 Ashley Lai             2012-08-22 @366  		kfree(ibmvtpm->rtce_buf);
132f76294744244 Ashley Lai             2012-08-22  367  	}
132f76294744244 Ashley Lai             2012-08-22  368  
132f76294744244 Ashley Lai             2012-08-22  369  	kfree(ibmvtpm);
31574d321c70f6d Hon Ching \(Vicky\  Lo 2017-03-15  370) 	/* For tpm_ibmvtpm_get_desired_dma */
31574d321c70f6d Hon Ching \(Vicky\  Lo 2017-03-15  371) 	dev_set_drvdata(&vdev->dev, NULL);
132f76294744244 Ashley Lai             2012-08-22  372  }
132f76294744244 Ashley Lai             2012-08-22  373  

:::::: The code at line 366 was first introduced by commit
:::::: 132f7629474424418a5cdd666796ad3cfa4dc0c5 drivers/char/tpm: Add new device driver to support IBM vTPM

:::::: TO: Ashley Lai <adlai@linux.vnet.ibm.com>
:::::: CC: Kent Yoder <key@linux.vnet.ibm.com>

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 9509/9522] drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Sun, 22 Aug 2021 00:41:20 +0800	[thread overview]
Message-ID: <202108220011.GPvXGLuO-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   86ed57fd8c93fdfaabb4f58e78455180fa7d8a84
commit: a389ba5e5df26c9b904434677fd00cde641e4745 [9509/9522] slab: clean up function declarations
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a389ba5e5df26c9b904434677fd00cde641e4745
        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 a389ba5e5df26c9b904434677fd00cde641e4745
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc 

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/char/tpm/tpm_ibmvtpm.c:125:30: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *p @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse:     expected void *p
   drivers/char/tpm/tpm_ibmvtpm.c:126:23: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:229:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse:     expected void const *objp
   drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *rtce_buf @@     got void * @@
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse:     expected void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:525:43: sparse:     got void *
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *ptr @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse:     expected void *ptr
   drivers/char/tpm/tpm_ibmvtpm.c:532:52: sparse:     got void [noderef] __iomem *rtce_buf
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got void [noderef] __iomem *rtce_buf @@
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse:     expected void const *objp
   drivers/char/tpm/tpm_ibmvtpm.c:538:46: sparse:     got void [noderef] __iomem *rtce_buf

vim +366 drivers/char/tpm/tpm_ibmvtpm.c

132f76294744244 Ashley Lai             2012-08-22  336  
132f76294744244 Ashley Lai             2012-08-22  337  /**
132f76294744244 Ashley Lai             2012-08-22  338   * tpm_ibmvtpm_remove - ibm vtpm remove entry point
132f76294744244 Ashley Lai             2012-08-22  339   * @vdev:	vio device struct
132f76294744244 Ashley Lai             2012-08-22  340   *
93c12f293f87982 Winkler, Tomas         2016-11-23  341   * Return: Always 0.
132f76294744244 Ashley Lai             2012-08-22  342   */
386a966f5ce71a0 Uwe Kleine-König       2021-02-25  343  static void tpm_ibmvtpm_remove(struct vio_dev *vdev)
132f76294744244 Ashley Lai             2012-08-22  344  {
9e0d39d8a6a0a88 Christophe Ricard      2016-03-31  345  	struct tpm_chip *chip = dev_get_drvdata(&vdev->dev);
9e0d39d8a6a0a88 Christophe Ricard      2016-03-31  346  	struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev);
132f76294744244 Ashley Lai             2012-08-22  347  	int rc = 0;
132f76294744244 Ashley Lai             2012-08-22  348  
afb5abc262e9620 Jarkko Sakkinen        2014-12-12  349  	tpm_chip_unregister(chip);
afb5abc262e9620 Jarkko Sakkinen        2014-12-12  350  
132f76294744244 Ashley Lai             2012-08-22  351  	free_irq(vdev->irq, ibmvtpm);
132f76294744244 Ashley Lai             2012-08-22  352  
132f76294744244 Ashley Lai             2012-08-22  353  	do {
132f76294744244 Ashley Lai             2012-08-22  354  		if (rc)
132f76294744244 Ashley Lai             2012-08-22  355  			msleep(100);
132f76294744244 Ashley Lai             2012-08-22  356  		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
132f76294744244 Ashley Lai             2012-08-22  357  	} while (rc == H_BUSY || H_IS_LONG_BUSY(rc));
132f76294744244 Ashley Lai             2012-08-22  358  
132f76294744244 Ashley Lai             2012-08-22  359  	dma_unmap_single(ibmvtpm->dev, ibmvtpm->crq_dma_handle,
132f76294744244 Ashley Lai             2012-08-22  360  			 CRQ_RES_BUF_SIZE, DMA_BIDIRECTIONAL);
132f76294744244 Ashley Lai             2012-08-22  361  	free_page((unsigned long)ibmvtpm->crq_queue.crq_addr);
132f76294744244 Ashley Lai             2012-08-22  362  
132f76294744244 Ashley Lai             2012-08-22  363  	if (ibmvtpm->rtce_buf) {
132f76294744244 Ashley Lai             2012-08-22  364  		dma_unmap_single(ibmvtpm->dev, ibmvtpm->rtce_dma_handle,
132f76294744244 Ashley Lai             2012-08-22  365  				 ibmvtpm->rtce_size, DMA_BIDIRECTIONAL);
132f76294744244 Ashley Lai             2012-08-22 @366  		kfree(ibmvtpm->rtce_buf);
132f76294744244 Ashley Lai             2012-08-22  367  	}
132f76294744244 Ashley Lai             2012-08-22  368  
132f76294744244 Ashley Lai             2012-08-22  369  	kfree(ibmvtpm);
31574d321c70f6d Hon Ching \(Vicky\  Lo 2017-03-15  370) 	/* For tpm_ibmvtpm_get_desired_dma */
31574d321c70f6d Hon Ching \(Vicky\  Lo 2017-03-15  371) 	dev_set_drvdata(&vdev->dev, NULL);
132f76294744244 Ashley Lai             2012-08-22  372  }
132f76294744244 Ashley Lai             2012-08-22  373  

:::::: The code at line 366 was first introduced by commit
:::::: 132f7629474424418a5cdd666796ad3cfa4dc0c5 drivers/char/tpm: Add new device driver to support IBM vTPM

:::::: TO: Ashley Lai <adlai@linux.vnet.ibm.com>
:::::: CC: Kent Yoder <key@linux.vnet.ibm.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: 73978 bytes --]

             reply	other threads:[~2021-08-21 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 16:41 kernel test robot [this message]
2021-08-21 16:41 ` [linux-next:master 9509/9522] drivers/char/tpm/tpm_ibmvtpm.c:366:30: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot

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=202108220011.GPvXGLuO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.