All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [jarkko-tpmdd:master 11/12] drivers/char/tpm/tpm_crb.c:464:34: sparse: sparse: cast removes address space '__iomem' of expression
Date: Fri, 30 Oct 2026 06:34:30 +0100	[thread overview]
Message-ID: <202610300657.PDvHNvHj-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-10-30  5:35 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=202610300657.PDvHNvHj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jarkko@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.