In vop_plane_atomic_update(), the variable offset is needlessly typed as
*unsigned long* -- which is 32-bit type on the 32-bit arches and 64-bit
type on the 64-bit arches. I highly doubt that this variable can exceed
4 GiB even on 64-bit arches, so let's redeclare it as *unsigned int*...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Sergey Shtylyov <[email protected]>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 1b466623b6c7..ee53755751ac 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -924,7 +924,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
        struct drm_rect *dest = &new_state->dst;
        struct drm_gem_object *obj, *uv_obj;
        struct rockchip_gem_object *rk_obj, *rk_uv_obj;
-       unsigned long offset;
+       unsigned int offset;
        dma_addr_t dma_addr;
        uint32_t val;
        bool rb_swap, uv_swap;
-- 
2.52.0

Reply via email to