public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: "T.J. Mercier" <tjmercier@google.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
	Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	Brian Starkey <Brian.Starkey@arm.com>,
	John Stultz <jstultz@google.com>,
	Christian König <christian.koenig@amd.com>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-buf: heaps: use max3() in dma_heap_ioctl
Date: Mon, 27 Apr 2026 10:40:07 -0700	[thread overview]
Message-ID: <CABdmKX1xp1=_EnicNGj1ZOp0dvma-YevvZk1_3V5FZ8ucUK32A@mail.gmail.com> (raw)
In-Reply-To: <20260427172519.417333-3-thorsten.blum@linux.dev>

On Mon, Apr 27, 2026 at 10:26 AM Thorsten Blum <thorsten.blum@linux.dev> wrote:
>
> Replace two nested max() calls with a single max3() in dma_heap_ioctl().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/dma-buf/dma-heap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
> index ac5f8685a649..52eec2ebb2e8 100644
> --- a/drivers/dma-buf/dma-heap.c
> +++ b/drivers/dma-buf/dma-heap.c
> @@ -153,7 +153,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);

Hi,

Could you add #include <linux/minmax.h> as well? It's currently missing.

With that: Reviewed-by: T.J.Mercier <tjmercier@google.com>

Thanks,
T.J.

  reply	other threads:[~2026-04-27 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 17:25 [PATCH] dma-buf: heaps: use max3() in dma_heap_ioctl Thorsten Blum
2026-04-27 17:40 ` T.J. Mercier [this message]
2026-04-28  4:15 ` Claude review: " Claude Code Review Bot
2026-04-28  4:15 ` Claude Code Review Bot

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='CABdmKX1xp1=_EnicNGj1ZOp0dvma-YevvZk1_3V5FZ8ucUK32A@mail.gmail.com' \
    --to=tjmercier@google.com \
    --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=thorsten.blum@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox