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@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
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 */