Skip to contentSkip to conversation

drm/amdgpu: add missing if clause guard

PATCH In review Nirmoy Das 2 participants 2 messages Mar 25, 2020

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add missing if clause guard

Fixes 635f3790ac964 (drm/amdgpu: don't try to reserve training bo for sriov)

compilation warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_init’:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1862:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
1862 | if (!amdgpu_sriov_vf(adev))

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
index 54cfa3a12135..e192557db421 100644
@@ -1859,10 +1859,11 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
 	 *The reserved vram for memory training must be pinned to the specified
 	 *place on the VRAM, so reserve it early.
 	 */
-	if (!amdgpu_sriov_vf(adev))
+	if (!amdgpu_sriov_vf(adev)) {
 		r = amdgpu_ttm_training_reserve_vram_init(adev);
 		if (r)
 			return r;
+	}
 
 	/* allocate memory as required for VGA
 	 * This is used for VGA emulation and pre-OS scanout buffers to
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Public Use]

________________________________
From: Nirmoy Das <[email protected]>
Sent: Wednesday, March 25, 2020 11:24 AM
To: [email protected] <[email protected]>
Cc: Liu, Monk <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Das, Nirmoy <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu: add missing if clause guard

Fixes 635f3790ac964 (drm/amdgpu: don't try to reserve training bo for sriov)

compilation warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_init’:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1862:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
1862 | if (!amdgpu_sriov_vf(adev))

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
index 54cfa3a12135..e192557db421 100644
@@ -1859,10 +1859,11 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
          *The reserved vram for memory training must be pinned to the specified
          *place on the VRAM, so reserve it early.
          */
-       if (!amdgpu_sriov_vf(adev))
+       if (!amdgpu_sriov_vf(adev)) {
                 r = amdgpu_ttm_training_reserve_vram_init(adev);
                 if (r)
                         return r;
+       }
 
         /* allocate memory as required for VGA
          * This is used for VGA emulation and pre-OS scanout buffers to

--
2.25.1

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