Skip to content

Commit

Permalink
drm/msm/mdp5: remove less than 0 comparison for unsigned value
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Aishwarya Pant authored and Daniel Vetter committed Oct 11, 2017
1 parent e25f1f7 commit 0c17151
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 0c17151

Please sign in to comment.