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

Deucher, Alexander Alexander.Deucher at amd.com
Wed Mar 25 15:22:28 UTC 2020


[AMD Public Use]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Nirmoy Das <nirmoy.aiemd at gmail.com>
Sent: Wednesday, March 25, 2020 11:24 AM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Liu, Monk <Monk.Liu at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Das, Nirmoy <Nirmoy.Das at amd.com>
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))

Signed-off-by: Nirmoy Das <nirmoy.das at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 54cfa3a12135..e192557db421 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200325/fdd6c3e1/attachment.htm>


More information about the amd-gfx mailing list