drm/amdgpu: clear the warning unsigned compared against 0 for xcp_id
authorJesse Zhang <jesse.zhang@amd.com>
Thu, 9 May 2024 09:49:54 +0000 (17:49 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 20:11:53 +0000 (16:11 -0400)
This greater-than-or-equal-to-zero comparison of an unsigned value is always true. fpriv->xcp_id >= 0U

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index 977cde6..66782be 100644 (file)
@@ -618,7 +618,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        return -EINVAL;
 
                if (adev->xcp_mgr && adev->xcp_mgr->num_xcps > 0 &&
-                   fpriv->xcp_id >= 0 && fpriv->xcp_id < adev->xcp_mgr->num_xcps) {
+                   fpriv->xcp_id < adev->xcp_mgr->num_xcps) {
                        xcp = &adev->xcp_mgr->xcp[fpriv->xcp_id];
                        switch (type) {
                        case AMD_IP_BLOCK_TYPE_GFX: