Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_vm warning

PATCH In review Junwei Zhang 2 participants 3 messages Apr 6, 2017 2 messages not in the archive

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

PATCH 1/1 drm/amdgpu: fix amdgpu_vm warning

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function 'amdgpu_vm_bo_update_mapping':

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1207:20: warning:

comparison of distinct pointer types lacks a cast [enabled by default]

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index bc2650ef..2209a6a 100644
@@ -1204,7 +1204,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	 * reserve space for one command every (1 << BLOCK_SIZE)
 	 *  entries or 2k dwords (whatever is smaller)
 	 */
-	ncmds = (nptes >> min(adev->vm_manager.block_size, 11)) + 1;
+	ncmds = (nptes >> min(adev->vm_manager.block_size, (uint32_t)11)) + 1;
 
 	/* padding, etc. */
 	ndw = 64;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1491487600-22722-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 06.04.2017 um 16:06 schrieb Junwei Zhang:

Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function 'amdgpu_vm_bo_update_mapping':

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1207:20: warning:

comparison of distinct pointer types lacks a cast [enabled by default]

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index bc2650ef..2209a6a 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1207

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -1204,7 +1204,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
  	 * reserve space for one command every (1 << BLOCK_SIZE)
  	 *  entries or 2k dwords (whatever is smaller)
  	 */
-	ncmds = (nptes >> min(adev->vm_manager.block_size, 11)) + 1;
+	ncmds = (nptes >> min(adev->vm_manager.block_size, (uint32_t)11)) + 1;

Writing this as "11u" should be sufficient as well and is more convenient.

With that fixed Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1210

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
  	/* padding, etc. */
  	ndw = 64;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 9a03821d-09f4-2b69-543d-e2e460c9b67a-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#4 lore raw
Quoted 14 lines · 在 2017年4月6日,22:03,Christian König <[email protected]> 写道:

Am 06.04.2017 um 16:06 schrieb Junwei Zhang:

Quoted 10 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function 'amdgpu_vm_bo_update_mapping':

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1207:20: warning:

comparison of distinct pointer types lacks a cast [enabled by default]

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1207

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index bc2650ef..2209a6a 100644
@@ -1204,7 +1204,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	 * reserve space for one command every (1 << BLOCK_SIZE)
 	 *  entries or 2k dwords (whatever is smaller)
 	 */
-	ncmds = (nptes >> min(adev->vm_manager.block_size, 11)) + 1;
+	ncmds = (nptes >> min(adev->vm_manager.block_size, (uint32_t)11)) + 1;

Writing this as "11u" should be sufficient as well and is more convenient.

Good point.
Will update.

Jerry

Quoted 10 lines

With that fixed Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
   	/* padding, etc. */
 	ndw = 64;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx