linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Christoph Hellwig <hch@lst.de>,
	iommu@lists.linux.dev,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Michal Hocko <mhocko@suse.com>,
	David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] dma-pool: factor out a calculate_pool_size helper
Date: Sun, 21 Aug 2022 12:41:21 +0200	[thread overview]
Message-ID: <20220821104121.GA30530@lst.de> (raw)
In-Reply-To: <777145ed-7936-6d8a-d706-57e609f4deb6@arm.com>

On Wed, Aug 17, 2022 at 01:32:42PM +0100, Robin Murphy wrote:
> On 2022-08-17 07:06, Christoph Hellwig wrote:
>> Add a helper to calculate the pool size from dma_atomic_pool_init,
>> and fix up the last max_t to use the proper type.
>
> Hmm, both atomic_pool_size and the argument to __dma_atomic_pool_init() 
> where this gets directly passed later are size_t, not to mention that the 
> function name says we're calculating a size, so I'd say size_t *is* the 
> proper type to return here.

But the type passed to calculate_pool_size isn't about the return type,
but rather the type to use for the comparing the other two arguments.

The should generally by the largest of the involved types.  Besides
that using a size_t for a number of pages is not a correct use of
size_t, but that's a separate story.

But I'll go back to what we had originally, there's no good reason
to change it in this series.

  reply	other threads:[~2022-08-21 10:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17  6:06 fix dma coherent pool sizing Christoph Hellwig
2022-08-17  6:06 ` [PATCH 1/3] dma-pool: factor out a calculate_pool_size helper Christoph Hellwig
2022-08-17 12:32   ` Robin Murphy
2022-08-21 10:41     ` Christoph Hellwig [this message]
2022-08-17  6:06 ` [PATCH 2/3] dma-pool: don't return errors from dma_atomic_pool_init Christoph Hellwig
2022-08-17 12:36   ` Robin Murphy
2022-08-17  6:06 ` [PATCH 3/3] dma-pool: limit DMA and DMA32 zone size pools Christoph Hellwig
2022-08-17 12:50   ` Robin Murphy
2022-08-21 10:43     ` Christoph Hellwig
2022-08-17 12:53   ` Michal Hocko
2022-08-21 10:44     ` Christoph Hellwig
2022-08-22  8:41       ` Michal Hocko
2022-08-22 11:14         ` Christoph Hellwig
2022-08-22 12:09           ` Michal Hocko
2022-08-22 12:27             ` Christoph Hellwig
2022-08-22 14:21               ` Michal Hocko
2022-08-22  6:12 fix dma coherent pool sizing Christoph Hellwig
2022-08-22  6:12 ` [PATCH 1/3] dma-pool: factor out a calculate_pool_size helper Christoph Hellwig

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=20220821104121.GA30530@lst.de \
    --to=hch@lst.de \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=robin.murphy@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).