Skip to contentSkip to conversation

drm/amdgpu: Fix implicit enum conversion in gfx_v9_4_ras_error_inject

PATCH Applied Nathan Chancellor 2 participants 2 messages Jan 30, 2020

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

PATCH 1/1 drm/amdgpu: Fix implicit enum conversion in gfx_v9_4_ras_error_inject

Clang warns:

../drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c:967:35: warning: implicit conversion from enumeration type 'enum amdgpu_ras_block' to different enumeration type 'enum ta_ras_block' [-Wenum-conversion]

        block_info.block_id = info->head.block;
                            ~ ~~~~~~~~~~~^~~~~

1 warning generated.

Use the function added in commit 828cfa29093f ("drm/amdgpu: Fix amdgpu ras to ta enums conversion") that handles this conversion explicitly.

Fixes 4c461d89db4f ("drm/amdgpu: add RAS support for the gfx block of Arcturus")
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c +1 -1
index e19d275f3f7d..f099f13d7f1e 100644
@@ -964,7 +964,7 @@ int gfx_v9_4_ras_error_inject(struct amdgpu_device *adev, void *inject_if)
 	if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
 		return -EINVAL;
 
-	block_info.block_id = info->head.block;
+	block_info.block_id = amdgpu_ras_block_to_ta(info->head.block);
 	block_info.sub_block_index = info->head.sub_block_index;
 	block_info.inject_error_type = amdgpu_ras_error_to_ta(info->head.type);
 	block_info.address = info->address;
Signature · 1 line
2.25.0
Applied
#1 lore raw
Quoted 8 lines · Nathan Chancellor

Clang warns:

../drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c:967:35: warning: implicit conversion from enumeration type 'enum amdgpu_ras_block' to different enumeration type 'enum ta_ras_block' [-Wenum-conversion]

        block_info.block_id = info->head.block;
                            ~ ~~~~~~~~~~~^~~~~
Quoted 8 lines

1 warning generated.

Use the function added in commit 828cfa29093f ("drm/amdgpu: Fix amdgpu ras to ta enums conversion") that handles this conversion explicitly.

Fixes 4c461d89db4f ("drm/amdgpu: add RAS support for the gfx block of Arcturus")

Applied. thanks!

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c +1 -2
index e19d275f3f7d..f099f13d7f1e 100644
@@ -964,7 +964,7 @@ int gfx_v9_4_ras_error_inject(struct amdgpu_device *adev, void *inject_if)
        if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
                return -EINVAL;
 
-       block_info.block_id = info->head.block;
+       block_info.block_id = amdgpu_ras_block_to_ta(info->head.block);
        block_info.sub_block_index = info->head.sub_block_index;
        block_info.inject_error_type = amdgpu_ras_error_to_ta(info->head.type);
        block_info.address = info->address;
--

2.25.0

Quoted 4 lines

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

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