summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-07-04 15:23:29 +0100
committertiancyin <tianci.yin@amd.com>2019-08-08 18:47:08 +0800
commitcf08c61611f13ef668fad85e09d194c79aeb226b (patch)
treef01ca09e350908a5c87f310a88e28fee3649ac10
parent82ee6298e7e3ebdba7a9f7a1043f0fb2ce779b59 (diff)
drm/amdgpu/psp: fix incorrect logic when checking asic_type
Currently the check of the asic_type is always returning true because of the use of ||. Fix this by using && instead. Also break overly wide line. Addresses-Coverity: ("Constant expression result") Fixes: dab70ff24db6 ("drm/amdgpu/psp: add psp support for navi14") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_v11_0.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 9128593a46fa..95f8e17c5786 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -583,7 +583,8 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
case AMDGPU_UCODE_ID_RLC_G:
*sram_offset = 0x2000;
- if (adev->asic_type != CHIP_NAVI10 || adev->asic_type != CHIP_NAVI14) {
+ if (adev->asic_type != CHIP_NAVI10 &&
+ adev->asic_type != CHIP_NAVI14) {
*sram_addr_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_ADDR);
*sram_data_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_DATA);
}
@@ -595,7 +596,8 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
case AMDGPU_UCODE_ID_SDMA0:
*sram_offset = 0x0;
- if (adev->asic_type != CHIP_NAVI10 || adev->asic_type != CHIP_NAVI14) {
+ if (adev->asic_type != CHIP_NAVI10 &&
+ adev->asic_type != CHIP_NAVI14) {
*sram_addr_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_ADDR);
*sram_data_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_DATA);
}