Skip to contentSkip to conversation

drm/radeon: fix variable type

PATCH In review Christian König 2 participants 2 messages Feb 21, 2022

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

PATCH 1/1 drm/radeon: fix variable type

When we switch to dma_resv_wait_timeout() the returned type changes as well.

Fixes 89aae41d740f ("drm/radeon: use dma_resv_wait_timeout() instead of manually waiting")
---
 drivers/gpu/drm/radeon/radeon_uvd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_uvd.c +4 -4
index 377f9cdb5b53..84013faa4756 100644
@@ -470,8 +470,8 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
 	int32_t *msg, msg_type, handle;
 	unsigned img_size = 0;
 	void *ptr;
-
-	int i, r;
+	long r;
+	int i;
 
 	if (offset & 0x3F) {
 		DRM_ERROR("UVD messages must be 64 byte aligned!\n");
@@ -481,13 +481,13 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
 	r = dma_resv_wait_timeout(bo->tbo.base.resv, false, false,
 				  MAX_SCHEDULE_TIMEOUT);
 	if (r <= 0) {
-		DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+		DRM_ERROR("Failed waiting for UVD message (%ld)!\n", r);
 		return r ? r : -ETIME;
 	}
 
 	r = radeon_bo_kmap(bo, &ptr);
 	if (r) {
-		DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
+		DRM_ERROR("Failed mapping the UVD message (%ld)!\n", r);
 		return r;
 	}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

[Public]

Add:

With that:

________________________________
From: amd-gfx <[email protected]> on behalf of Christian König <[email protected]>
Sent: Monday, February 21, 2022 6:05 AM
To: [email protected] <[email protected]>
Cc: Koenig, Christian <[email protected]>
Subject: [PATCH] drm/radeon: fix variable type

When we switch to dma_resv_wait_timeout() the returned type changes as well.

Fixes 89aae41d740f ("drm/radeon: use dma_resv_wait_timeout() instead of manually waiting")
---
 drivers/gpu/drm/radeon/radeon_uvd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_uvd.c +4 -4
index 377f9cdb5b53..84013faa4756 100644
@@ -470,8 +470,8 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
         int32_t *msg, msg_type, handle;
         unsigned img_size = 0;
         void *ptr;
-
-       int i, r;
+       long r;
+       int i;
 
         if (offset & 0x3F) {
                 DRM_ERROR("UVD messages must be 64 byte aligned!\n");
@@ -481,13 +481,13 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
         r = dma_resv_wait_timeout(bo->tbo.base.resv, false, false,
                                   MAX_SCHEDULE_TIMEOUT);
         if (r <= 0) {
-               DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+               DRM_ERROR("Failed waiting for UVD message (%ld)!\n", r);
                 return r ? r : -ETIME;
         }
 
         r = radeon_bo_kmap(bo, &ptr);
         if (r) {
-               DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
+               DRM_ERROR("Failed mapping the UVD message (%ld)!\n", r);
                 return r;
         }
 

--
2.25.1