diff options
author | Tao Zhou <tao.zhou1@amd.com> | 2019-09-17 14:01:38 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-10-03 17:11:02 +0300 |
commit | fc04e6b4843c82be61478b9edec6e4e7b87e9de4 (patch) | |
tree | f94ce9a9e83c76065059f8e116c7b3860d33dedf /drivers | |
parent | 4c65dd1041074f7c7e1202636c3f83cdf285c8f2 (diff) | |
download | linux-fc04e6b4843c82be61478b9edec6e4e7b87e9de4.tar.xz |
drm/amdgpu: refine sdma4 ras_data_cb
simplify code logic and refine return value
v2: remove unused error source code
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 68a9dfe9d375..4db4e329e74b 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1942,28 +1942,18 @@ static int sdma_v4_0_process_ras_data_cb(struct amdgpu_device *adev, void *err_data, struct amdgpu_iv_entry *entry) { - uint32_t err_source; int instance; - if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) { - instance = sdma_v4_0_irq_id_to_seq(entry->client_id); - if (instance < 0) - return 0; + if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) + goto out; - switch (entry->src_id) { - case SDMA0_4_0__SRCID__SDMA_SRAM_ECC: - err_source = 0; - break; - case SDMA0_4_0__SRCID__SDMA_ECC: - err_source = 1; - break; - default: - return 0; - } + instance = sdma_v4_0_irq_id_to_seq(entry->client_id); + if (instance < 0) + goto out; - amdgpu_sdma_process_ras_data_cb(adev, err_data, entry); - } + amdgpu_sdma_process_ras_data_cb(adev, err_data, entry); +out: return AMDGPU_RAS_SUCCESS; } |