mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
drm/rockchip: vop2: fix compile warning
[clang] drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2709:9: warning: Division by zero [core.DivideZero] Signed-off-by: Sandy Huang <hjc@rock-chips.com> Change-Id: I95a28037ab52a10e3d2e333b773ade4f8e2e0c87
This commit is contained in:
@@ -2700,10 +2700,8 @@ static uint16_t vop2_scale_factor(enum scale_mode mode,
|
||||
/*
|
||||
* A workaround to avoid zero div.
|
||||
*/
|
||||
if ((dst == 1) || (src == 1)) {
|
||||
dst = dst + 1;
|
||||
src = src + 1;
|
||||
}
|
||||
if (dst < 2)
|
||||
dst = 2;
|
||||
|
||||
if ((mode == SCALE_DOWN) && (filter_mode == VOP2_SCALE_DOWN_BIL)) {
|
||||
fac = VOP2_BILI_SCL_DN(src, dst);
|
||||
|
||||
Reference in New Issue
Block a user