media: mediatek: vcodec: fix minmax.cocci warning
authorGuo Zhengkui <guozhengkui@vivo.com>
Tue, 14 Jun 2022 07:25:59 +0000 (08:25 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 27 Jun 2022 08:01:02 +0000 (09:01 +0100)
Fix the following coccicheck warning:

drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c:
694:15-16: WARNING opportunity for min().

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c

index f464af190d8ca4bd9f3805efbb261f202321afc4..81de876d51267d54b42c2a6db795675a3ed8be92 100644 (file)
@@ -691,7 +691,7 @@ static int vdec_vp9_slice_tile_offset(int idx, int mi_num, int tile_log2)
        int sbs = (mi_num + 7) >> 3;
        int offset = ((idx * sbs) >> tile_log2) << 3;
 
-       return offset < mi_num ? offset : mi_num;
+       return min(offset, mi_num);
 }
 
 static