public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Alexander Steffen <Alexander.Steffen@infineon.com>
Cc: tpmdd-devel@lists.sourceforge.net, stable@vger.kernel.org
Subject: Re: [tpmdd-devel] [PATCH] tpm_tis_spi: Use DMA-safe memory for SPI transfers
Date: Sun, 9 Jul 2017 15:11:50 -0600	[thread overview]
Message-ID: <20170709211150.GA19327@obsidianresearch.com> (raw)
In-Reply-To: <20170704135609.5064-1-Alexander.Steffen@infineon.com>

On Tue, Jul 04, 2017 at 03:56:09PM +0200, Alexander Steffen wrote:
>  struct tpm_tis_spi_phy {
>  	struct tpm_tis_data priv;
>  	struct spi_device *spi_device;
> -
> -	u8 tx_buf[4];
> -	u8 rx_buf[4];
> +	u8 *iobuf;

tpm_tis_spi_phy is already devm_kzalloc'd, why embed another kalloc
pointer inside it?

> +	phy->iobuf = devm_kmalloc(&dev->dev, MAX_SPI_FRAMESIZE, GFP_KERNEL);
> +	if (!phy->iobuf)
> +		return -ENOMEM;

Just do:

  struct tpm_tis_spi_phy {
  	struct tpm_tis_data priv;
  	struct spi_device *spi_device;
        u64 iobuf[MAX_SPI_FRAMESIZE/8];

Jason

  reply	other threads:[~2017-07-09 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 13:56 [PATCH] tpm_tis_spi: Use DMA-safe memory for SPI transfers Alexander Steffen
2017-07-09 21:11 ` Jason Gunthorpe [this message]
2017-07-27 13:38   ` [tpmdd-devel] " Alexander.Steffen
2017-07-16 11:41 ` Jarkko Sakkinen

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=20170709211150.GA19327@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=Alexander.Steffen@infineon.com \
    --cc=stable@vger.kernel.org \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /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