mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: feng.wei8@zte.com.cn, sumit.semwal@linaro.org
Cc: benjamin.gaignard@collabora.com, brian.starkey@arm.com,
	jstultz@google.com, tjmercier@google.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] Replace nested max() with single max3()
Date: Mon, 17 Mar 2025 14:59:19 +0100	[thread overview]
Message-ID: <9351765f-685f-4de8-b1e0-695627a29af0@amd.com> (raw)
In-Reply-To: <20250315124009404aGYiofkCnWFti1fQoFZ58@zte.com.cn>

Am 15.03.25 um 05:40 schrieb feng.wei8@zte.com.cn:
> From: FengWei <feng.wei8@zte.com.cn>
>
> Use max3() macro instead of nesting max() to simplify the return
> statement.

Please add a "dma-buf: heaps: " prefix to the subject line, apart from that looks good to me.

Regards,
Christian.

>
> Signed-off-by: FengWei <feng.wei8@zte.com.cn>
> ---
>  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 3cbe87d4a464..96cb9ab5731a 100644
> --- a/drivers/dma-buf/dma-heap.c
> +++ b/drivers/dma-buf/dma-heap.c
> @@ -147,7 +147,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)) {


      reply	other threads:[~2025-03-17 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15  4:40 feng.wei8
2025-03-17 13:59 ` Christian König [this message]

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=9351765f-685f-4de8-b1e0-695627a29af0@amd.com \
    --to=christian.koenig@amd.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=feng.wei8@zte.com.cn \
    --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

all inboxes | Powered by JetHome®