Skip to contentSkip to conversation

drm/amdgpu: fix empty return on non-void function

PATCH In review Nirmoy Das 2 participants 2 messages Feb 4, 2020

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix empty return on non-void function

This fixes empty return on non-void function, amdgpu_xgmi_remove_device

Fixes b80574252499e (drm/amdgpu: move xgmi init/fini to xgmi_add/remove_device call)
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -2
index 78989e9560d1..490f57d6704c 100644
@@ -463,11 +463,11 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
 	struct amdgpu_hive_info *hive;
 
 	if (!adev->gmc.xgmi.supported)
-		return;
+		return -EINVAL;
 
 	hive = amdgpu_get_xgmi_hive(adev, 1);
 	if (!hive)
-		return;
+		return -EINVAL;
 
 	if (!(hive->number_devices--)) {
 		amdgpu_xgmi_sysfs_destroy(adev, hive);
Signature · 6 lines
2.25.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Nirmoy Das

This fixes empty return on non-void function, amdgpu_xgmi_remove_device

Fixes b80574252499e (drm/amdgpu: move xgmi init/fini to xgmi_add/remove_device call)
Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -3
index 78989e9560d1..490f57d6704c 100644
@@ -463,11 +463,11 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
        struct amdgpu_hive_info *hive;
 
        if (!adev->gmc.xgmi.supported)
-               return;
+               return -EINVAL;
 
        hive = amdgpu_get_xgmi_hive(adev, 1);
        if (!hive)
-               return;
+               return -EINVAL;
 
        if (!(hive->number_devices--)) {
                amdgpu_xgmi_sysfs_destroy(adev, hive);
--

2.25.0

Quoted 4 lines

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

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