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: <6531e5e0-d4d5-1a16-5c5c-e8ff443f3275@gmail.com>
Date:   Fri, 27 May 2022 11:28:06 +0200
From:   Andrzej Pietrasiewicz <andrzejtp2010@...il.com>
To:     Guo Zhengkui <guozhengkui@...o.com>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        Sylwester Nawrocki <s.nawrocki@...sung.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        "moderated list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" 
        <linux-arm-kernel@...ts.infradead.org>,
        "open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" 
        <linux-media@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Cc:     zhengkui_guo@...look.com
Subject: Re: [PATCH v2] media: platform: samsung: s5p-jpeg: replace ternary
 operator with max()

Hi Guo Zhengkui,

Sorry about the delay.

W dniu 18.05.2022 o 14:08, Guo Zhengkui pisze:
> Fix the following coccicheck warning:
> 
> drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c:1712:24-25:
> WARNING opportunity for max()
> 
> max() macro is defined in include/linux/minmax.h. It avoids multiple
> evaluations of the arguments when non-constant and performs strict
> type-checking.
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>

Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@...il.com>

> ---
> v1 -> v2: Change the subject according to Hans Verkuil's suggestion.
> 
>   drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> index 456287186ad8..55814041b8d8 100644
> --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> @@ -1709,7 +1709,7 @@ static int exynos3250_jpeg_try_downscale(struct s5p_jpeg_ctx *ctx,
>   	w_ratio = ctx->out_q.w / r->width;
>   	h_ratio = ctx->out_q.h / r->height;
>   
> -	scale_factor = w_ratio > h_ratio ? w_ratio : h_ratio;
> +	scale_factor = max(w_ratio, h_ratio);
>   	scale_factor = clamp_val(scale_factor, 1, 8);
>   
>   	/* Align scale ratio to the nearest power of 2 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ