lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABdmKX02xw+bDiW9ruXO+nLtDdidQsfKOp-N7NgvACHKyYq8xw@mail.gmail.com>
Date: Sun, 16 Mar 2025 09:41:01 -0700
From: "T.J. Mercier" <tjmercier@...gle.com>
To: feng.wei8@....com.cn
Cc: sumit.semwal@...aro.org, benjamin.gaignard@...labora.com, 
	brian.starkey@....com, jstultz@...gle.com, christian.koenig@....com, 
	linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org, 
	linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma-buf: Replace nested max() with single max3()

On Fri, Mar 14, 2025 at 10:02 PM <feng.wei8@....com.cn> wrote:
>
> From: FengWei <feng.wei8@....com.cn>
>
> Use max3() macro instead of nesting max() to simplify the return
> statement.
>
> Signed-off-by: FengWei <feng.wei8@....com.cn>

The commit subject should include "dma-buf: heaps:" as a prefix.

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

> ---
>  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)) {
> --
> 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ