Skip to contentSkip to conversation

drm/radeon: Drop unnecessary unsigned int < 0 check

PATCH Applied Thierry Reding 2 participants 2 messages Jan 4, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: Drop unnecessary unsigned int < 0 check

From: Thierry Reding <[email protected]>

Unsigned integers can never be negative, so drop this check.

Cc Christian König <[email protected]>
Cc Alex Deucher <[email protected]>
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_kms.c +1 -1
index 4fab44e0f36b..414953c46a38 100644
@@ -759,7 +759,7 @@ u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)
 	u32 count;
 	struct radeon_device *rdev = dev->dev_private;
 
-	if (pipe < 0 || pipe >= rdev->num_crtc) {
+	if (pipe >= rdev->num_crtc) {
 		DRM_ERROR("Invalid crtc %u\n", pipe);
 		return -EINVAL;
 	}
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 7 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Unsigned integers can never be negative, so drop this check.

Cc Christian König <[email protected]>
Cc Alex Deucher <[email protected]>

Applied. thanks!

Alex

Quoted 20 lines
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_kms.c +1 -2
index 4fab44e0f36b..414953c46a38 100644
@@ -759,7 +759,7 @@ u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)
        u32 count;
        struct radeon_device *rdev = dev->dev_private;
 
-       if (pipe < 0 || pipe >= rdev->num_crtc) {
+       if (pipe >= rdev->num_crtc) {
                DRM_ERROR("Invalid crtc %u\n", pipe);
                return -EINVAL;
        }
--

2.5.0

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel