]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/msm/mdp5: remove less than 0 comparison for unsigned value
authorAishwarya Pant <aishpant@gmail.com>
Tue, 10 Oct 2017 18:42:07 +0000 (00:12 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 11 Oct 2017 11:17:52 +0000 (13:17 +0200)
pipe is an unsigned int and less than zero comparison for unsigned
values is always false.

Detected using the following cocci script:

@@
unsigned int i;
@@
* i < 0

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010184207.iv3dinrtwvbv7fei@aishwarya
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c

index f7c0698fec4012b2a2faa8fe6481917b59004dcf..7e829a8d1cb18797a0971d1a61ef6e2cbce7e8e2 100644 (file)
@@ -599,7 +599,7 @@ static u32 mdp5_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
        struct drm_crtc *crtc;
        struct drm_encoder *encoder;
 
-       if (pipe < 0 || pipe >= priv->num_crtcs)
+       if (pipe >= priv->num_crtcs)
                return 0;
 
        crtc = priv->crtcs[pipe];