From: Thorsten Blum <thorsten.blum@linux.dev>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Brian Starkey" <Brian.Starkey@arm.com>,
"John Stultz" <jstultz@google.com>,
"T.J. Mercier" <tjmercier@google.com>,
"Christian König" <christian.koenig@amd.com>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2] dma-buf: heaps: use max3 in dma_heap_ioctl
Date: Wed, 3 Jun 2026 00:44:17 +0200 [thread overview]
Message-ID: <ah9cwXA2CO5VB6Kf@linux.dev> (raw)
In-Reply-To: <20260517172352.3615-2-thorsten.blum@linux.dev>
Gentle ping?
On Sun, May 17, 2026 at 07:23:53PM +0200, Thorsten Blum wrote:
> Replace two nested max() calls with a single max3() in dma_heap_ioctl().
>
> Reviewed-by: T.J. Mercier <tjmercier@google.com>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> Changes in v2:
> - Include minmax.h as suggested by T.J. Mercier
> - v1: https://lore.kernel.org/lkml/20260427172519.417333-3-thorsten.blum@linux.dev/
> ---
> drivers/dma-buf/dma-heap.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
> index ac5f8685a649..d49188893608 100644
> --- a/drivers/dma-buf/dma-heap.c
> +++ b/drivers/dma-buf/dma-heap.c
> @@ -13,6 +13,7 @@
> #include <linux/err.h>
> #include <linux/export.h>
> #include <linux/list.h>
> +#include <linux/minmax.h>
> #include <linux/nospec.h>
> #include <linux/syscalls.h>
> #include <linux/uaccess.h>
> @@ -153,7 +154,7 @@ static long dma_heap_ioctl(struct file *file, unsigned int ucmd,
> in_size = 0;
> if ((ucmd & kcmd & IOC_OUT) == 0)
> out_size = 0;
> - ksize = max(max(in_size, out_size), drv_size);
> + ksize = max3(in_size, out_size, drv_size);
>
> /* If necessary, allocate buffer for ioctl argument */
> if (ksize > sizeof(stack_kdata)) {
next prev parent reply other threads:[~2026-06-02 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 17:23 [PATCH RESEND v2] dma-buf: heaps: use max3 in dma_heap_ioctl Thorsten Blum
2026-06-02 22:44 ` Thorsten Blum [this message]
2026-06-03 9:00 ` Sumit Semwal
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=ah9cwXA2CO5VB6Kf@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=Brian.Starkey@arm.com \
--cc=benjamin.gaignard@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jstultz@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.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