All of lore.kernel.org
 help / color / mirror / Atom feed
* [jarkko-tpmdd:master 11/12] drivers/char/tpm/tpm_crb.c:464:34: sparse: sparse: cast removes address space '__iomem' of expression
@ 2026-10-30  5:34 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-30  5:34 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git master
head:   7e8d0278a462f604dd884db39b76d0ac3c1ad652
commit: ed59034d94f5764452a57efb85bb2ae5c3061a5b [11/12] tpm_crb: Implement command and response chunking logic
config: i386-randconfig-2302-20261030 (https://download.01.org/0day-ci/archive/20261030/202610300657.PDvHNvHj-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261030/202610300657.PDvHNvHj-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610300657.PDvHNvHj-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/char/tpm/tpm_crb.c:464:34: sparse: sparse: cast removes address space '__iomem' of expression

vim +/__iomem +464 drivers/char/tpm/tpm_crb.c

   443	
   444	static int crb_recv(struct tpm_chip *chip, u8 *buf, size_t count)
   445	{
   446		struct crb_priv *priv = dev_get_drvdata(&chip->dev);
   447		unsigned int expected;
   448	
   449		/*
   450		 * A sanity check that the upper layer wants to get at least the header
   451		 * as that is the minimum size for any TPM response.
   452		 */
   453		if (count < TPM_HEADER_SIZE)
   454			return -EIO;
   455	
   456		/*
   457		 * If this bit is set, according to the spec, the TPM is in
   458		 * unrecoverable condition.
   459		 */
   460		if (ioread32(&priv->regs_t->ctrl_sts) & CRB_CTRL_STS_ERROR)
   461			return -EIO;
   462	
   463		/* Peek at the first 8 bytes to determine the response size */
 > 464		expected = be32_to_cpup((__be32 *)&priv->rsp[2]);
   465	
   466		if (expected <= priv->rsp_size)
   467			return tpm_crb_recv_no_chunks(chip, buf, count);
   468		if (!(priv->intf_id & CRB_INTF_CAP_CRB_CHUNK)) {
   469			dev_err(&chip->dev,
   470				"Response larger than MMIO and chunking not supported\n");
   471			return -EIO;
   472		}
   473		return tpm_crb_recv_chunks(chip, buf, count, expected);
   474	}
   475	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2026-10-30  5:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  5:34 [jarkko-tpmdd:master 11/12] drivers/char/tpm/tpm_crb.c:464:34: sparse: sparse: cast removes address space '__iomem' of expression kernel test robot

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.