aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-08-01 12:01:45 +0100
committerAlex Deucher <alexander.deucher@amd.com>2019-08-02 10:30:38 -0500
commitac4bf4a1ebce7554628db89498ec49054c7bcdba (patch)
tree425d4b9f798e249c4fd9f785eab06bfd5ee49a04 /drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
parentdrm/amd/powerplay: Allow changing of fan_control in smu_v11_0 (diff)
downloadlinux-dev-ac4bf4a1ebce7554628db89498ec49054c7bcdba.tar.xz
linux-dev-ac4bf4a1ebce7554628db89498ec49054c7bcdba.zip
drm/amdgpu: fix unsigned variable instance compared to less than zero
Currenly the error check on variable instance is always false because it is a uint32_t type and this is never less than zero. Fix this by making it an int type. Addresses-Coverity: ("Unsigned compared against 0") Fixes: 7d0e6329dfdc ("drm/amdgpu: update more sdma instances irq support") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 61d995dd6a28..30153c36efd6 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1963,7 +1963,8 @@ static int sdma_v4_0_process_ras_data_cb(struct amdgpu_device *adev,
struct ras_err_data *err_data,
struct amdgpu_iv_entry *entry)
{
- uint32_t instance, err_source;
+ uint32_t err_source;
+ int instance;
instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
if (instance < 0)