From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH for-4.13] nvme-pci: use dma memory for the host memory buffer descriptors
Date: Tue, 29 Aug 2017 16:50:33 +0200 [thread overview]
Message-ID: <20170829145032.GA32673@lst.de> (raw)
In-Reply-To: <20170829135923.GF9310@linux-x5ow.site>
On Tue, Aug 29, 2017@03:59:23PM +0200, Johannes Thumshirn wrote:
> On Mon, Aug 28, 2017@10:47:18AM +0200, Christoph Hellwig wrote:
> > - descs = kcalloc(max_entries, sizeof(*descs), GFP_KERNEL);
> > + descs = dma_zalloc_coherent(dev->dev, max_entries * sizeof(*descs),
> > + &descs_dma, GFP_KERNEL);
>
> [...]
>
> > - kfree(descs);
> > + dma_free_coherent(dev->dev, max_entries * sizeof(*dev->host_mem_descs),
> > + descs, descs_dma);
>
> If the patch isn't super urgent, I'd prefere the sizeof() arguments being
> aligned, i.e. either sizeof(*descs) _or_ sizeof(*dev->host_mem_descs) but not
> both. It's rather confusing for the reader. Maybe just cache the max_entries *
> sizeof(*dev->host_mem_descs) value?
Sure, I'll fix it up.
next prev parent reply other threads:[~2017-08-29 14:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 8:47 [PATCH for-4.13] nvme-pci: use dma memory for the host memory buffer descriptors Christoph Hellwig
2017-08-29 13:13 ` Christoph Hellwig
2017-08-29 13:59 ` Johannes Thumshirn
2017-08-29 14:50 ` Christoph Hellwig [this message]
2017-08-29 22:00 ` Keith Busch
2017-08-30 10:05 ` Sagi Grimberg
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=20170829145032.GA32673@lst.de \
--to=hch@lst.de \
/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.